[PATCH] NFC: pn533: Fix device leak

DORMANTno replies

From: Alexey Khoroshilov <hidden>
Date: 2014-03-21 22:21:03
Also in: lkml
Subsystem: nfc subsystem, the rest · Maintainers: David Heidelberg, Linus Torvalds

pn533_probe() calls usb_get_dev(), but there is no usb_put_dev()
in pn533_disconnect(). The patch adds one.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <redacted>
---
 drivers/nfc/pn533.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index cf1a87bb74f8..fed19d5473bb 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -3301,6 +3301,7 @@ static void pn533_disconnect(struct usb_interface *interface)
 
 	usb_free_urb(dev->in_urb);
 	usb_free_urb(dev->out_urb);
+	usb_put_dev(dev->udev);
 	kfree(dev);
 
 	nfc_info(&interface->dev, "NXP PN533 NFC device disconnected\n");
-- 
1.8.3.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help