lkml.org 
[lkml]   [2012]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
Subject[PATCH] xenbus: don't free other end details too early
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 <jbeulich@suse.com>

---
drivers/xen/xenbus/xenbus_probe.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- 3.3-rc6/drivers/xen/xenbus/xenbus_probe.c
+++ 3.3-rc6-xenbus-remove-details/drivers/xen/xenbus/xenbus_probe.c
@@ -257,11 +257,12 @@ int xenbus_dev_remove(struct device *_de
DPRINTK("%s", dev->nodename);

free_otherend_watch(dev);
- free_otherend_details(dev);

if (drv->remove)
drv->remove(dev);

+ free_otherend_details(dev);
+
xenbus_switch_state(dev, XenbusStateClosed);
return 0;
}


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 <jbeulich@suse.com>

---
drivers/xen/xenbus/xenbus_probe.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- 3.3-rc6/drivers/xen/xenbus/xenbus_probe.c
+++ 3.3-rc6-xenbus-remove-details/drivers/xen/xenbus/xenbus_probe.c
@@ -257,11 +257,12 @@ int xenbus_dev_remove(struct device *_de
DPRINTK("%s", dev->nodename);

free_otherend_watch(dev);
- free_otherend_details(dev);

if (drv->remove)
drv->remove(dev);

+ free_otherend_details(dev);
+
xenbus_switch_state(dev, XenbusStateClosed);
return 0;
}
\
 
 \ /
  Last update: 2012-03-05 18:13    [W:0.245 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site