From: "Jan Beulich" Subject: [PATCH] linux-2.6.18/xenbus: don't free other end details too early Date: Tue, 06 Mar 2012 08:49:20 +0000 Message-ID: <4F55DDA00200007800076954@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part3D132A80.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part3D132A80.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline The individual drivers' remove functions could legitimately attempt to access this information (for logging messages if nothing else). Note that I did not in fact observe a problem anywhere, but I came across this while looking into the reasons for what turned out to need the fix at https://lkml.org/lkml/2012/3/5/336 to vsprintf(). Signed-off-by: Jan Beulich --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c @@ -332,11 +332,12 @@ int xenbus_dev_remove(struct device *_de DPRINTK("%s", dev->nodename); =20 free_otherend_watch(dev); - free_otherend_details(dev); =20 if (drv->remove) drv->remove(dev); =20 + free_otherend_details(dev); + xenbus_switch_state(dev, XenbusStateClosed); return 0; } --=__Part3D132A80.0__= Content-Type: text/plain; name="xen-xenbus-remove-details.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xen-xenbus-remove-details.patch" xenbus: don't free other end details too early=0A=0AThe individual = drivers' remove functions could legitimately attempt to=0Aaccess this = information (for logging messages if nothing else). Note=0Athat I did not = in fact observe a problem anywhere, but I came across=0Athis while looking = into the reasons for what turned out to need the=0Afix at https://lkml.org/= lkml/2012/3/5/336 to vsprintf().=0A=0ASigned-off-by: Jan Beulich =0A=0A--- a/drivers/xen/xenbus/xenbus_probe.c=0A+++ b/drivers/xen/= xenbus/xenbus_probe.c=0A@@ -332,11 +332,12 @@ int xenbus_dev_remove(struct = device *_de=0A DPRINTK("%s", dev->nodename);=0A =0A free_otherend_watch= (dev);=0A- free_otherend_details(dev);=0A =0A if (drv->remove)=0A= drv->remove(dev);=0A =0A+ free_otherend_details(dev);= =0A+=0A xenbus_switch_state(dev, XenbusStateClosed);=0A = return 0;=0A }=0A --=__Part3D132A80.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part3D132A80.0__=--