* [PATCH] xenbus: don't free other end details too early
@ 2012-03-05 17:11 Jan Beulich
2012-03-14 16:33 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2012-03-05 17:11 UTC (permalink / raw)
To: Jeremy Fitzhardinge, Konrad Rzeszutek Wilk; +Cc: xen-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 923 bytes --]
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;
}
[-- Attachment #2: linux-3.3-rc6-xenbus-remove-details.patch --]
[-- Type: text/plain, Size: 917 bytes --]
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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] xenbus: don't free other end details too early
2012-03-05 17:11 [PATCH] xenbus: don't free other end details too early Jan Beulich
@ 2012-03-14 16:33 ` Konrad Rzeszutek Wilk
0 siblings, 0 replies; 2+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-03-14 16:33 UTC (permalink / raw)
To: Jan Beulich; +Cc: Jeremy Fitzhardinge, xen-devel, linux-kernel
On Mon, Mar 05, 2012 at 05:11:31PM +0000, Jan Beulich wrote:
> 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().
applied.
>
> 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;
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-14 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 17:11 [PATCH] xenbus: don't free other end details too early Jan Beulich
2012-03-14 16:33 ` Konrad Rzeszutek Wilk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox