From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH] xenbus: fix possible crash in xenbus_uevent_backend Date: Mon, 18 Jul 2011 17:02:58 +0200 Message-ID: <20110718150258.GA13123@aepfle.de> References: <20110718124059.GA7893@aepfle.de> <1310994684.20648.47.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: <1310994684.20648.47.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, Jul 18, Ian Campbell wrote: > On Mon, 2011-07-18 at 13:40 +0100, Olaf Hering wrote: > > Fix possible NULL pointer crash in xenbus_uevent_backend(). > > The variable to check for should probably be bus. > > > > Signed-off-by: Olaf Hering > > > > Index: linux-3.0-rc7-xen-kexec/drivers/xen/xenbus/xenbus_probe_backend.c > > =================================================================== > > --- linux-3.0-rc7-xen-kexec.orig/drivers/xen/xenbus/xenbus_probe_backend.c > > +++ linux-3.0-rc7-xen-kexec/drivers/xen/xenbus/xenbus_probe_backend.c > > @@ -104,7 +104,7 @@ static int xenbus_uevent_backend(struct > > > > xdev = to_xenbus_device(dev); > > bus = container_of(xdev->dev.bus, struct xen_bus_type, bus); > > - if (xdev == NULL) > > + if (bus == NULL) > > return -ENODEV; > > Is this fixing an actual crash which you observed of just something you > noticed looking at the code? I was browsing the code. Thanks to you and Jan for reviewing my attempt to fix something thats not broken. I will prepare a better patch. Olaf