Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: usbip: remove double giveback of URB

In the vhci_urb_dequeue() function the TCP connection is checked twice.
Each time when the TCP connection is closed the URB is unlinked and given
back. Remove the second attempt of unlinking and giving back of the URB completely.

This patch fixes the bug described at https://bugzilla.kernel.org/show_bug.cgi?id=24872 .

Signed-off-by: Márton Németh <nm127@freemail.hu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Márton Németh and committed by
Greg Kroah-Hartman
7571f089 63d5e5a7

-14
-14
drivers/staging/usbip/vhci_hcd.c
··· 799 799 spin_unlock_irqrestore(&vdev->priv_lock, flags2); 800 800 } 801 801 802 - 803 - if (!vdev->ud.tcp_socket) { 804 - /* tcp connection is closed */ 805 - usbip_uinfo("vhci_hcd: vhci_urb_dequeue() gives back urb %p\n", 806 - urb); 807 - 808 - usb_hcd_unlink_urb_from_ep(hcd, urb); 809 - 810 - spin_unlock_irqrestore(&the_controller->lock, flags); 811 - usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb, 812 - urb->status); 813 - spin_lock_irqsave(&the_controller->lock, flags); 814 - } 815 - 816 802 spin_unlock_irqrestore(&the_controller->lock, flags); 817 803 818 804 usbip_dbg_vhci_hc("leave\n");