lkml.org 
[lkml]   [2012]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] staging: usbip: put usb_device and kill event handler thread in error cleanups.
Date
From: harvey.yang <harvey.huawei.yang@gmail.com>

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

Signed-off-by: harvey.yang <harvey.huawei.yang@gmail.com>
---
drivers/staging/usbip/stub_dev.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c
index c8d79a7..16a6868 100644
--- a/drivers/staging/usbip/stub_dev.c
+++ b/drivers/staging/usbip/stub_dev.c
@@ -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;
--
1.7.1


\
 
 \ /
  Last update: 2012-11-06 09:43    [W:0.029 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site