Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1653351
| From | Johan Hovold <johan@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/7] USB: core: fix device node leak |
| Date | 2017-05-30 18:30 +0200 |
| Message-ID | <tMSbT-1dJ-1@gated-at.bofh.it> (permalink) |
| References | <tMSbT-1dJ-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/7] USB: core: fix device node leak Johan Hovold <johan@kernel.org> - 2017-05-30 18:30 +0200
Re: [PATCH 1/7] USB: core: fix device node leak Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2017-05-31 01:00 +0200
Re: [PATCH 1/7] USB: core: fix device node leak Johan Hovold <johan@kernel.org> - 2017-05-31 10:30 +0200
csiph-web