* [PATCH 1/2] USB: core: fix device node leak
[not found] <20170529143223.7397-1-johan@kernel.org>
@ 2017-05-29 14:32 ` Johan Hovold
0 siblings, 0 replies; only message in thread
From: Johan Hovold @ 2017-05-29 14:32 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb, Johan Hovold, stable, Peter Chen
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);
--
2.13.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-05-29 14:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20170529143223.7397-1-johan@kernel.org>
2017-05-29 14:32 ` [PATCH 1/2] USB: core: fix device node leak Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).