Skip to content

Commit e5bdfd5

Browse files
committed
Revert "usb: hub: do not clear BOS field during reset device"
This reverts commit d8f00cd. Tony writes: This upstream commit is causing an oops: d8f00cd ("usb: hub: do not clear BOS field during reset device") This patch has already been included in several -stable kernels. Here are the affected kernels: 4.5.0-rc4 (current git) 4.4.2 4.3.6 (currently in review) 4.1.18 3.18.27 3.14.61 How to reproduce the problem: Boot kernel with slub debugging enabled (otherwise memory corruption will cause random oopses later instead of immediately) Plug in USB 3.0 disk to xhci USB 3.0 port dd if=/dev/sdc of=/dev/null bs=65536 (where /dev/sdc is the USB 3.0 disk) Unplug USB cable while dd is still going Oops is immediate: Reported-by: Tony Battersby <[email protected]> Cc: Du, Changbin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f9a96d2 commit e5bdfd5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/usb/core/hub.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5401,6 +5401,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
54015401
}
54025402

54035403
bos = udev->bos;
5404+
udev->bos = NULL;
54045405

54055406
for (i = 0; i < SET_CONFIG_TRIES; ++i) {
54065407

@@ -5493,11 +5494,8 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
54935494
usb_set_usb2_hardware_lpm(udev, 1);
54945495
usb_unlocked_enable_lpm(udev);
54955496
usb_enable_ltm(udev);
5496-
/* release the new BOS descriptor allocated by hub_port_init() */
5497-
if (udev->bos != bos) {
5498-
usb_release_bos_descriptor(udev);
5499-
udev->bos = bos;
5500-
}
5497+
usb_release_bos_descriptor(udev);
5498+
udev->bos = bos;
55015499
return 0;
55025500

55035501
re_enumerate:

0 commit comments

Comments
 (0)