lkml.org 
[lkml]   [2017]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] USB: core: fix device node leak
On Tue, May 30, 2017 at 06:25:48PM +0200, Johan Hovold wrote:
> Make sure to release any OF device-node reference taken when creating
> the USB device.
>
> Note that we currently do not hold a reference to the root hub
> device-tree node (i.e. the parent controller node).
>
> Fixes: 69bec7259853 ("USB: core: let USB device know device node")
> Cc: stable <stable@vger.kernel.org> # v4.6
> Cc: Peter Chen <peter.chen@nxp.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
> drivers/usb/core/usb.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
> index 28b053cacc90..62e1906bb2f3 100644
> --- a/drivers/usb/core/usb.c
> +++ b/drivers/usb/core/usb.c
> @@ -416,6 +416,8 @@ static void usb_release_dev(struct device *dev)
>
> usb_destroy_configuration(udev);
> usb_release_bos_descriptor(udev);
> + if (udev->parent)
> + of_node_put(dev->of_node);
> usb_put_hcd(hcd);
> kfree(udev->product);
> kfree(udev->manufacturer);

Acked-by: Peter Chen <peter.chen@nxp.com>

--

Best Regards,
Peter Chen

\
 
 \ /
  Last update: 2017-06-05 05:36    [W:0.325 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site