WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [Xen-changelog] Don't free subtype field unconditionally

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [Xen-changelog] Don't free subtype field unconditionally.
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Thu, 18 Aug 2005 15:34:08 -0500
Delivery-date: Thu, 18 Aug 2005 20:33:41 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E1E5qHG-0007uZ-NI@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
References: <E1E5qHG-0007uZ-NI@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.8.2
On Thursday 18 August 2005 14:42, Xen patchbot -unstable wrote:
> # HG changeset patch
> # User cl349@xxxxxxxxxxxxxxxxxxxx
> # Node ID 8d69cb2d4a8889780930fff0374559839fb6cdfb
> # Parent  2f09b40595eafd845433d1a25366df59eeb4b6b2
> Don't free subtype field unconditionally.
> Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
>
> diff -r 2f09b40595ea -r 8d69cb2d4a88
> linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c ---
> a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c      Thu Aug 18
> 19:06:51 2005 +++
> b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c      Thu Aug 18
> 19:07:29 2005 @@ -262,7 +262,8 @@
>       if (dev) {
>               struct xenbus_device *xendev = to_xenbus_device(dev);
>
> -             kfree(xendev->subtype);
> +             if (xendev->subtype)
> +                     kfree(xendev->subtype);
>               kfree(xendev);
>       }
>  }

I don't think this change is necessary. kfree already guards against NULL 
pointers, and I have seen many patches in exactly the opposite direction 
(removing pre-kfree tests).

-- 
Hollis Blanchard
IBM Linux Technology Center

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>