diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2021-02-10 16:06:33 +0200 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2021-03-08 14:22:35 +0300 |
commit | 781e14eaa7d168dc07d2a2eea5c55831a5bb46f3 (patch) | |
tree | 9de2cf204f2430554eb0a504a9e02eb6c385c47d /block/blk-ioc.c | |
parent | a38fd8748464831584a19438cbb3082b5a2dab15 (diff) | |
download | linux-stable-781e14eaa7d168dc07d2a2eea5c55831a5bb46f3.tar.gz linux-stable-781e14eaa7d168dc07d2a2eea5c55831a5bb46f3.tar.bz2 linux-stable-781e14eaa7d168dc07d2a2eea5c55831a5bb46f3.zip |
thunderbolt: Initialize HopID IDAs in tb_switch_alloc()
If there is a failure before the tb_switch_add() is called the switch
object is released by tb_switch_release() but at that point HopID IDAs
have not yet been initialized. So we see splat like this:
BUG: spinlock bad magic on CPU#2, kworker/u8:5/115
...
Workqueue: thunderbolt0 tb_handle_hotplug
Call Trace:
dump_stack+0x97/0xdc
? spin_bug+0x9a/0xa7
do_raw_spin_lock+0x68/0x98
_raw_spin_lock_irqsave+0x3f/0x5d
ida_destroy+0x4f/0x127
tb_switch_release+0x6d/0xfd
device_release+0x2c/0x7d
kobject_put+0x9b/0xbc
tb_handle_hotplug+0x278/0x452
process_one_work+0x1db/0x396
worker_thread+0x216/0x375
kthread+0x14d/0x155
? pr_cont_work+0x58/0x58
? kthread_blkcg+0x2e/0x2e
ret_from_fork+0x1f/0x40
Fix this by always initializing HopID IDAs in tb_switch_alloc().
Fixes: 0b2863ac3cfd ("thunderbolt: Add functions for allocating and releasing HopIDs")
Cc: stable@vger.kernel.org
Reported-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'block/blk-ioc.c')
0 files changed, 0 insertions, 0 deletions