From: Hollis Blanchard Subject: Re: [Xen-changelog] Don't free subtype field unconditionally. Date: Thu, 18 Aug 2005 15:34:08 -0500 Message-ID: <200508181534.08675.hollisb@us.ibm.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Thursday 18 August 2005 14:42, Xen patchbot -unstable wrote: > # HG changeset patch > # User cl349@firebug.cl.cam.ac.uk > # Node ID 8d69cb2d4a8889780930fff0374559839fb6cdfb > # Parent 2f09b40595eafd845433d1a25366df59eeb4b6b2 > Don't free subtype field unconditionally. > Signed-off-by: Christian Limpach > > 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