Commit fedbe19
FROMLIST: Bluetooth: btusb: Add NULL check for data in btusb_suspend
When performing warm boot tests with an MT7920 device, we encounter
NULL pointer dereferences with failure rate 5/30. The crash occurs
during device suspend when btusb attempts to access data->hdev where
data is NULL. This may happen due to a race condition between PM suspend
and device disconnect. The root cause needs further investigation.
BUG: kernel NULL pointer dereference, address: 0000000000000000
Workqueue: pm pm_runtime_work
RIP: 0010:btusb_suspend+0x1d/0x1d0 [btusb]
Add a NULL check for data and return -ENODEV in this case to prevent
the NULL pointer dereference. This indicates that the device is no
longer available, which is appropriate when the driver's private data
is missing.
Signed-off-by: En-Wei Wu <en-wei.wu@canonical.com>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>1 parent 5c62e9f commit fedbe19
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4075 | 4075 | | |
4076 | 4076 | | |
4077 | 4077 | | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
4078 | 4081 | | |
4079 | 4082 | | |
4080 | 4083 | | |
| |||
0 commit comments