Revert "usb: hub: do not clear BOS field during reset device"

This reverts commit d8f00cd685f5c8e0def8593e520a7fef12c22407.

Tony writes:

This upstream commit is causing an oops:
d8f00cd685f5 ("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 <tonyb@cybernetics.com>
Cc: Du, Changbin <changbin.du@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+3 -5
+3 -5
drivers/usb/core/hub.c
··· 5401 } 5402 5403 bos = udev->bos; 5404 5405 for (i = 0; i < SET_CONFIG_TRIES; ++i) { 5406 ··· 5494 usb_set_usb2_hardware_lpm(udev, 1); 5495 usb_unlocked_enable_lpm(udev); 5496 usb_enable_ltm(udev); 5497 - /* release the new BOS descriptor allocated by hub_port_init() */ 5498 - if (udev->bos != bos) { 5499 - usb_release_bos_descriptor(udev); 5500 - udev->bos = bos; 5501 - } 5502 return 0; 5503 5504 re_enumerate:
··· 5401 } 5402 5403 bos = udev->bos; 5404 + udev->bos = NULL; 5405 5406 for (i = 0; i < SET_CONFIG_TRIES; ++i) { 5407 ··· 5493 usb_set_usb2_hardware_lpm(udev, 1); 5494 usb_unlocked_enable_lpm(udev); 5495 usb_enable_ltm(udev); 5496 + usb_release_bos_descriptor(udev); 5497 + udev->bos = bos; 5498 return 0; 5499 5500 re_enumerate: