Commit 1e35d149 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: core: fix device node leak

commit e271b2c9 upstream.

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: 69bec725 ("USB: core: let USB device know device node")
Acked-by: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c3a90ecd
...@@ -416,6 +416,8 @@ static void usb_release_dev(struct device *dev) ...@@ -416,6 +416,8 @@ static void usb_release_dev(struct device *dev)
usb_destroy_configuration(udev); usb_destroy_configuration(udev);
usb_release_bos_descriptor(udev); usb_release_bos_descriptor(udev);
if (udev->parent)
of_node_put(dev->of_node);
usb_put_hcd(hcd); usb_put_hcd(hcd);
kfree(udev->product); kfree(udev->product);
kfree(udev->manufacturer); kfree(udev->manufacturer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment