OpenCloudOS-Kernel/drivers/usb/core
Du, Changbin d8f00cd685 usb: hub: do not clear BOS field during reset device
In function usb_reset_and_verify_device, the old BOS descriptor may
still be used before allocating a new one. (usb_unlocked_disable_lpm
function uses it under the situation that it fails to disable lpm.)
So we cannot set the udev->bos to NULL before that, just keep what it
was. It will be overwrite when allocating a new one.

Crash log:
BUG: unable to handle kernel NULL pointer dereference at
0000000000000010
IP: [<ffffffff8171f98d>] usb_enable_link_state+0x2d/0x2f0
Call Trace:
[<ffffffff8171ed5b>] ? usb_set_lpm_timeout+0x12b/0x140
[<ffffffff8171fcd1>] usb_enable_lpm+0x81/0xa0
[<ffffffff8171fdd8>] usb_disable_lpm+0xa8/0xc0
[<ffffffff8171fe1c>] usb_unlocked_disable_lpm+0x2c/0x50
[<ffffffff81723933>] usb_reset_and_verify_device+0xc3/0x710
[<ffffffff8172c4ed>] ? usb_sg_wait+0x13d/0x190
[<ffffffff81724743>] usb_reset_device+0x133/0x280
[<ffffffff8179ccd1>] usb_stor_port_reset+0x61/0x70
[<ffffffff8179cd68>] usb_stor_invoke_transport+0x88/0x520

Signed-off-by: Du, Changbin <changbin.du@intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-24 21:06:21 -08:00
..
Kconfig usb: kconfig: fix warning of select USB_OTG 2015-11-19 16:31:42 -08:00
Makefile USB: core: remove CONFIG_USB_DEBUG usage 2013-12-21 16:01:00 -08:00
buffer.c Usb: core: buffer: fixed the checkpatch warning 2015-05-10 15:44:10 +02:00
config.c usb: Use the USB_SS_MULT() macro to decode burst multiplier for log message 2015-12-01 14:45:52 -08:00
devices.c new helpers: no_seek_end_llseek{,_size}() 2015-12-23 10:41:31 -05:00
devio.c USB patches for 4.5-rc1 2016-01-13 09:26:40 -08:00
driver.c usb: core: driver: Use kmalloc_array 2015-10-04 10:47:19 +01:00
endpoint.c usb: endpoint: convert spaces to tabs 2015-08-14 16:50:36 -07:00
file.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-11-13 15:34:18 +09:00
generic.c staging: usbip: convert usbip-host driver to usb_device_driver 2014-02-07 10:54:30 -08:00
hcd-pci.c USB / PM: Drop CONFIG_PM_RUNTIME from the USB core 2014-12-04 00:51:54 +01:00
hcd.c USB: constify usb_mon_operations structure 2015-12-01 14:36:29 -08:00
hub.c usb: hub: do not clear BOS field during reset device 2016-01-24 21:06:21 -08:00
hub.h usb: core: lpm: add sysfs node for usb3 lpm permit 2015-12-01 14:58:18 -08:00
message.c usb: message: remove redundant declaration 2015-10-04 10:45:11 +01:00
notify.c usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
otg_whitelist.h usb: otg_whitelist: remove whitespace 2015-08-14 16:50:36 -07:00
port.c More power management and ACPI updates for v4.5-rc1 2016-01-20 19:06:49 -08:00
quirks.c USB: add quirk for devices with broken LPM 2015-12-11 15:40:51 -08:00
sysfs.c usb: core: lpm: fix usb3_hardware_lpm sysfs node 2015-12-01 14:58:18 -08:00
urb.c USB: core: Codestyle fix in urb.c 2015-10-26 04:04:48 +09:00
usb-acpi.c usb: find internal hub tier mismatch via acpi 2014-05-27 16:38:52 -07:00
usb.c More power management and ACPI updates for v4.5-rc1 2016-01-20 19:06:49 -08:00
usb.h usb: interface authorization: Introduces the USB interface authorization 2015-09-22 12:08:40 -07:00