Skip to contentSkip to conversation

staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd

PATCH New navin patidar 1 participant 1 message Sep 14, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd

In response to "usbip detach -p [port_number]" user command,vhci_shoutdown_connection gets executed which kills tcp_tx,tcp_rx kernel threads and then vhci_device_reset resets all usb_device struct variables except kernel thread pointers.

so, at the time of vhci_hcd removal vhci_shoutdown_connection tries to kill kernel threads which are already killed.

---
 drivers/staging/usbip/vhci_hcd.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/staging/usbip/vhci_hcd.c +3 -0
index 6076f42..b1f427c 100644
@@ -858,6 +858,9 @@ static void vhci_device_reset(struct usbip_device *ud)
 	if (vdev->udev)
 		usb_put_dev(vdev->udev);
 	vdev->udev = NULL;
+	/* Reset kernel thread pointers */
+	ud->tcp_rx = NULL;
+	ud->tcp_tx = NULL;
 
 	ud->tcp_socket = NULL;
 	ud->status = VDEV_ST_NULL;
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.
-------------------------------------------------------------------------------------------------------------------------------