Skip to contentSkip to conversation

staging: usbip: put usb_device and kill event handler thread in error cleanups.

PATCH New Harvey Yang 1 participant 1 message Nov 6, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: usbip: put usb_device and kill event handler thread in error cleanups.

From: harvey.yang <[email protected]>

If probe returns with error, the kthread is still alive even when all usbip modules unloaded. So do cleanups in error handler.

---
 drivers/staging/usbip/stub_dev.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/staging/usbip/stub_dev.c +2 -0
index c8d79a7..16a6868 100644
@@ -432,6 +432,8 @@ static int stub_probe(struct usb_interface *interface,
 		dev_err(&interface->dev, "stub_add_files for %s\n", udev_busid);
 		usb_set_intfdata(interface, NULL);
 		usb_put_intf(interface);
+		usb_put_dev(udev);
+		kthread_stop_put(sdev->ud.eh);
 
 		busid_priv->interf_count = 0;
 		busid_priv->sdev = NULL;
Signature · 1 line
1.7.1