Skip to contentSkip to conversation

staging: usbip: stub_dev: Fixed oops during removal of usbip_host

PATCH In review navin patidar 3 participants 4 messages Sep 14, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: usbip: stub_dev: Fixed oops during removal of usbip_host

stub_device_reset should set kernel thread pointers to NULL. so that at the time of usbip_host removal stub_shoutdown_connection doesn't try to kill kernel threads which are already killed.

---
 drivers/staging/usbip/stub_dev.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/staging/usbip/stub_dev.c +4 -3
index 92ced35..447a98c 100644
@@ -198,10 +198,8 @@ static void stub_shutdown_connection(struct usbip_device *ud)
 	 * tcp_socket is freed after threads are killed so that usbip_xmit does
 	 * not touch NULL socket.
 	 */
-	if (ud->tcp_socket) {
+	if (ud->tcp_socket)
 		sock_release(ud->tcp_socket);
-		ud->tcp_socket = NULL;
-	}
 
 	/* 3. free used data */
 	stub_device_cleanup_urbs(sdev);
@@ -233,6 +231,9 @@ static void stub_device_reset(struct usbip_device *ud)
 
 	dev_dbg(&udev->dev, "device reset");
 
+	ud->tcp_socket = NULL;
+	ud->tcp_rx = NULL;
+	ud->tcp_tx = NULL;
 	ret = usb_lock_device_for_reset(udev, sdev->interface);
 	if (ret < 0) {
 		dev_err(&udev->dev, "lock for reset\n");
Signature · 12 lines
1.7.9.5


-------------------------------------------------------------------------------------------------------------------------------

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------
#1 lore raw
Quoted 4 lines · navin patidar

stub_device_reset should set kernel thread pointers to NULL. so that at the time of usbip_host removal stub_shoutdown_connection doesn't try to kill kernel threads which are already killed.

If you wanted to put a sample Oops stack trace in here, that would always be welcome. It's not something to resend over. Just an idea.

Quoted 9 lines

-------------------------------------------------------------------------------------------------------------------------------

This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------

I don't think this text is allowed on patches. This is a thing where you probably will need to resend the patch.

regards,
dan carpenter

#2 lore raw
Quoted 1 line · Dan Carpenter

I don't think this text is allowed on patches.

Oh Oh Oh Dan, I think you crossed a line here. You were not one of the recipient and you reviewed and forwarded the email but you should have deleted this email instead. Now legal action will be taken…

Quoted 2 lines

regards,
dan carpenter

Sebastian

#3 lore raw
Quoted 7 lines · Sebastian Andrzej Siewior
Quoted 1 line · Dan Carpenter

I don't think this text is allowed on patches.

Oh Oh Oh Dan, I think you crossed a line here. You were not one of the recipient and you reviewed and forwarded the email but you should have deleted this email instead. Now legal action will be taken…

Oh crap!

Well, it's a good thing I am a fully AWCP certified survivalist. I'm off to live in the mountains until the statute of limitations runs out. If you need me, then print your email out and leave it under a rock.

regards,
dan carpenter