Skip to content

Commit 73e87c0

Browse files
jhovoldVudentz
authored andcommitted
Bluetooth: qca: fix NULL-deref on non-serdev suspend
Qualcomm ROME controllers can be registered from the Bluetooth line discipline and in this case the HCI UART serdev pointer is NULL. Add the missing sanity check to prevent a NULL-pointer dereference when wakeup() is called for a non-serdev controller during suspend. Just return true for now to restore the original behaviour and address the crash with pre-6.2 kernels, which do not have commit e9b3e5b ("Bluetooth: hci_qca: only assign wakeup with serial port support") that causes the crash to happen already at setup() time. Fixes: c1a7416 ("Bluetooth: hci_qca: Add device_may_wakeup support") Cc: [email protected] # 5.13 Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 18bdb38 commit 73e87c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,9 @@ static bool qca_wakeup(struct hci_dev *hdev)
16721672
struct hci_uart *hu = hci_get_drvdata(hdev);
16731673
bool wakeup;
16741674

1675+
if (!hu->serdev)
1676+
return true;
1677+
16751678
/* BT SoC attached through the serial bus is handled by the serdev driver.
16761679
* So we need to use the device handle of the serdev driver to get the
16771680
* status of device may wakeup.

0 commit comments

Comments
 (0)