Reyad Attiyat
46df9dedab
HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removed
Set disconnected flag in struct usbhid when a usb device is removed. Check for
disconnected flag before sending urb requests. This prevents a kernel panic
when a hid driver calls hid_hw_request() after removing a usb device.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
IP: [<ffffffff8161746f>] hid_submit_ctrl+0x7f/0x290
PGD 0
Oops: 0002 [#1] PREEMPT SMP
CPU: 2 PID: 39 Comm: khubd Tainted: G IO 3.16.0-rc5+ #112
Hardware name: Microsoft Corporation Surface Pro 2/Surface Pro 2, BIOS 2.03.0250 09/06/2013
task: ffff880118aba6e0 ti: ffff8800daf80000 task.ti: ffff8800daf80000
RIP: 0010:[<ffffffff8161746f>] [<ffffffff8161746f>] hid_submit_ctrl+0x7f/0x290
RSP: 0018:ffff8800daf83750 EFLAGS: 00010086
RAX: 0000000080000300 RBX: ffff88003f60c000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff880117f78000
RBP: ffff8800daf83788 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000000 R12: ffff880117f78000
R13: ffff88003f11a290 R14: 000000000000000c R15: ffff880091cb3ab8
FS: 0000000000000000(0000) GS:ffff88011b000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000058 CR3: 0000000001c11000 CR4: 00000000001407e0
Stack:
ffff880117f3dcd0 ffff880117f78000 ffff88003f60c000 ffff880117f78000
ffff880117f78000 ffff88003f11a290 0000000000000000 ffff8800daf837b0
ffffffff81617707 ffff880117f78000 ffff88003f60c000 0000000000000013
Call Trace:
[<ffffffff81617707>] usbhid_restart_ctrl_queue+0x87/0x140
[<ffffffff81617a88>] usbhid_submit_report+0x2c8/0x370
[<ffffffff81617b4a>] usbhid_request+0x1a/0x30
[<ffffffffa020edfb>] sensor_hub_set_feature+0x8b/0xd0 [hid_sensor_hub]
[<ffffffffa02d9084>] hid_sensor_power_state+0x84/0x110 [hid_sensor_trigger]
[<ffffffffa02d9129>] hid_sensor_data_rdy_trigger_set_state+0x19/0x20 [hid_sensor_trigger]
[<ffffffffa034d5b7>] iio_triggered_buffer_predisable+0xa7/0xb0 [industrialio]
[<ffffffffa034cc4a>] iio_disable_all_buffers+0x3a/0xc0 [industrialio]
[<ffffffffa03487d3>] iio_device_unregister+0x53/0x80 [industrialio]
[<ffffffffa026c06a>] hid_accel_3d_remove+0x2a/0x50 [hid_sensor_accel_3d]
[<ffffffff814f433d>] platform_drv_remove+0x1d/0x40
[<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0
[<ffffffff814f1955>] device_release_driver+0x25/0x40
[<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0
[<ffffffff814ed7d6>] device_del+0x136/0x1e0
[<ffffffff81512190>] ? mfd_cell_disable+0x80/0x80
[<ffffffff814f41d1>] platform_device_del+0x21/0xc0
[<ffffffff814f4282>] platform_device_unregister+0x12/0x30
[<ffffffff815121d3>] mfd_remove_devices_fn+0x43/0x50
[<ffffffff814ed3e3>] device_for_each_child+0x43/0x70
[<ffffffff81512105>] mfd_remove_devices+0x25/0x30
[<ffffffffa020ebd7>] sensor_hub_remove+0x87/0x140 [hid_sensor_hub]
[<ffffffff81607c5b>] hid_device_remove+0x6b/0xd0
[<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0
[<ffffffff814f1955>] device_release_driver+0x25/0x40
[<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0
[<ffffffff814ed7d6>] device_del+0x136/0x1e0
[<ffffffff81607d47>] hid_destroy_device+0x27/0x60
[<ffffffff81616972>] usbhid_disconnect+0x22/0x50
[<ffffffff81568597>] usb_unbind_interface+0x77/0x2b0
[<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0
[<ffffffff814f1955>] device_release_driver+0x25/0x40
[<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0
[<ffffffff814ed7d6>] device_del+0x136/0x1e0
[<ffffffff81565cd1>] usb_disable_device+0x91/0x2a0
[<ffffffff8155b046>] usb_disconnect+0x96/0x2e0
[<ffffffff8155d74a>] hub_thread+0xb5a/0x1840
Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|
2014-07-29 13:03:38 +02:00 |
| .. |
|
accessibility
|
|
|
|
acpi
|
This is the bulk of pin control changes for the v3.16
|
2014-06-03 11:20:32 -07:00 |
|
amba
|
|
|
|
ata
|
|
|
|
atm
|
|
|
|
auxdisplay
|
|
|
|
base
|
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next
|
2014-06-04 08:50:34 -07:00 |
|
bcma
|
|
|
|
block
|
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 14:00:15 -07:00 |
|
bluetooth
|
TTY/Serial driver patches for 3.16-rc1
|
2014-06-03 09:01:02 -07:00 |
|
bus
|
ARM: SoC driver changes
|
2014-06-02 16:35:49 -07:00 |
|
cdrom
|
|
|
|
char
|
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 14:00:15 -07:00 |
|
clk
|
ARM: SoC driver changes
|
2014-06-02 16:35:49 -07:00 |
|
clocksource
|
clocksource: versatile: Use sched_clock_register()
|
2014-06-04 07:46:10 -07:00 |
|
connector
|
Char / misc driver patches for 3.16-rc1
|
2014-06-03 08:06:56 -07:00 |
|
cpufreq
|
ARM: SoC driver changes
|
2014-06-02 16:35:49 -07:00 |
|
cpuidle
|
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 14:00:15 -07:00 |
|
crypto
|
crypto/nx/nx-842: dev_set_drvdata can no longer fail
|
2014-05-28 13:39:51 -07:00 |
|
dca
|
|
|
|
devfreq
|
|
|
|
dio
|
|
|
|
dma
|
ARM: SoC driver changes
|
2014-06-02 16:35:49 -07:00 |
|
edac
|
PCI changes for the v3.16 merge window:
|
2014-06-02 12:15:19 -07:00 |
|
eisa
|
|
|
|
extcon
|
|
|
|
firewire
|
IEEE 1394 (FireWire) subsystem changes:
|
2014-06-04 07:47:03 -07:00 |
|
firmware
|
|
|
|
fmc
|
|
|
|
gpio
|
This is the bulk of GPIO changes for the v3.16 series:
|
2014-06-02 08:46:03 -07:00 |
|
gpu
|
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next
|
2014-06-04 08:50:34 -07:00 |
|
hid
|
HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removed
|
2014-07-29 13:03:38 +02:00 |
|
hsi
|
|
|
|
hv
|
hv: use correct order when freeing monitor_pages
|
2014-05-28 13:45:15 -07:00 |
|
hwmon
|
New driver for NCT6683D
|
2014-06-03 11:09:43 -07:00 |
|
hwspinlock
|
|
|
|
i2c
|
|
|
|
ide
|
|
|
|
idle
|
|
|
|
iio
|
Staging driver patches for 3.16-rc1
|
2014-06-03 08:34:00 -07:00 |
|
infiniband
|
|
|
|
input
|
ARM: SoC updates for 3.16 (part 1)
|
2014-06-02 16:15:12 -07:00 |
|
iommu
|
Driver core / kernfs pull request for 3.16-rc1
|
2014-06-03 08:07:41 -07:00 |
|
ipack
|
|
|
|
irqchip
|
ARM: SoC updates for 3.16 (part 1)
|
2014-06-02 16:15:12 -07:00 |
|
isdn
|
|
|
|
leds
|
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid into next
|
2014-06-04 08:52:36 -07:00 |
|
lguest
|
|
|
|
macintosh
|
|
|
|
mailbox
|
|
|
|
mcb
|
mcb: Add support for shared PCI IRQs
|
2014-05-27 17:38:11 -07:00 |
|
md
|
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 12:57:53 -07:00 |
|
media
|
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 12:57:53 -07:00 |
|
memory
|
|
|
|
memstick
|
|
|
|
message
|
|
|
|
mfd
|
regulator: Updates for v3.16
|
2014-06-03 11:44:48 -07:00 |
|
misc
|
Merge branch 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 15:48:23 -07:00 |
|
mmc
|
Updates for mmci driver:
|
2014-06-02 09:22:24 -07:00 |
|
mtd
|
Merge branch 'for-3.16/core' of git://git.kernel.dk/linux-block into next
|
2014-06-02 09:29:34 -07:00 |
|
net
|
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next
|
2014-06-04 08:50:34 -07:00 |
|
nfc
|
|
|
|
ntb
|
|
|
|
nubus
|
|
|
|
of
|
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next
|
2014-06-04 08:50:34 -07:00 |
|
oprofile
|
|
|
|
parisc
|
|
|
|
parport
|
parport: Add support for the WCH353 1S/1P multi-IO card
|
2014-05-28 12:30:48 -07:00 |
|
pci
|
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next
|
2014-06-04 08:50:34 -07:00 |
|
pcmcia
|
|
|
|
phy
|
|
|
|
pinctrl
|
This is the bulk of pin control changes for the v3.16
|
2014-06-03 11:20:32 -07:00 |
|
platform
|
Staging driver patches for 3.16-rc1
|
2014-06-03 08:34:00 -07:00 |
|
pnp
|
|
|
|
power
|
regulator: Updates for v3.16
|
2014-06-03 11:44:48 -07:00 |
|
powercap
|
|
|
|
pps
|
|
|
|
ps3
|
|
|
|
ptp
|
|
|
|
pwm
|
|
|
|
rapidio
|
|
|
|
regulator
|
regulator: Updates for v3.16
|
2014-06-03 11:44:48 -07:00 |
|
remoteproc
|
|
|
|
reset
|
ARM: SoC driver changes
|
2014-06-02 16:35:49 -07:00 |
|
rpmsg
|
|
|
|
rtc
|
|
|
|
s390
|
At over 200 commits, covering almost all supported architectures, this
|
2014-06-04 08:47:12 -07:00 |
|
sbus
|
|
|
|
scsi
|
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next
|
2014-06-04 08:50:34 -07:00 |
|
sfi
|
|
|
|
sh
|
|
|
|
sn
|
|
|
|
soc
|
|
|
|
spi
|
Merge remote-tracking branch 'spi/topic/workqueue' into spi-next
|
2014-06-02 17:08:43 +01:00 |
|
spmi
|
|
|
|
ssb
|
|
|
|
staging
|
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next
|
2014-06-04 08:50:34 -07:00 |
|
target
|
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 12:57:53 -07:00 |
|
tc
|
|
|
|
thermal
|
|
|
|
tty
|
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 12:57:53 -07:00 |
|
uio
|
|
|
|
usb
|
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 12:57:53 -07:00 |
|
uwb
|
|
|
|
vfio
|
|
|
|
vhost
|
|
|
|
video
|
TTY/Serial driver patches for 3.16-rc1
|
2014-06-03 09:01:02 -07:00 |
|
virt
|
|
|
|
virtio
|
|
|
|
vlynq
|
|
|
|
vme
|
|
|
|
w1
|
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 12:57:53 -07:00 |
|
watchdog
|
|
|
|
xen
|
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
|
2014-06-03 12:57:53 -07:00 |
|
zorro
|
|
|
|
Kconfig
|
|
|
|
Makefile
|
Char / misc driver patches for 3.16-rc1
|
2014-06-03 08:06:56 -07:00 |