diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-20 14:19:34 -0800 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-05-12 22:02:24 -0400 |
commit | 65b49b662365b54d3c372734a8591b404a43397f (patch) | |
tree | 9c888c4dbfc26262a6fad6da3cd7e45842543c17 | |
parent | 6b12ebc0ecce75d7bd3660cd85f8b47a615c2071 (diff) | |
download | lwn-65b49b662365b54d3c372734a8591b404a43397f.tar.gz lwn-65b49b662365b54d3c372734a8591b404a43397f.zip |
Revert "usb: hub: do not clear BOS field during reset device"
This reverts commit f9b3d78ac42bda9cd30e4c6d0149dba7067c402c.
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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r-- | drivers/usb/core/hub.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d8e1d5c1b9d2..74d856c7522b 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -5369,6 +5369,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev) } bos = udev->bos; + udev->bos = NULL; for (i = 0; i < SET_CONFIG_TRIES; ++i) { @@ -5461,11 +5462,8 @@ done: usb_set_usb2_hardware_lpm(udev, 1); usb_unlocked_enable_lpm(udev); usb_enable_ltm(udev); - /* release the new BOS descriptor allocated by hub_port_init() */ - if (udev->bos != bos) { - usb_release_bos_descriptor(udev); - udev->bos = bos; - } + usb_release_bos_descriptor(udev); + udev->bos = bos; return 0; re_enumerate: |