lkml.org 
[lkml]   [2014]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Xen-devel] [PATCH 26/38] xen: xenbus: add missing put_device call
On 19/12/13 15:03, Levente Kurusa wrote:
> This is required so that we give up the last reference to the device.
>
> Signed-off-by: Levente Kurusa <levex@linux.com>
> ---
> drivers/xen/xenbus/xenbus_probe.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
> index 3c0a74b..4abb9ee 100644
> --- a/drivers/xen/xenbus/xenbus_probe.c
> +++ b/drivers/xen/xenbus/xenbus_probe.c
> @@ -465,8 +465,10 @@ int xenbus_probe_node(struct xen_bus_type *bus,
>
> /* Register with generic device framework. */
> err = device_register(&xendev->dev);
> - if (err)
> + if (err) {
> + put_device(&xendev->dev);
> goto fail;
> + }
>
> return 0;
> fail:

There is a kfree(xendev) here so this introduces a double-free.

David



\
 
 \ /
  Last update: 2014-01-02 15:21    [W:0.269 / U:1.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site