Skip to content

Commit 7ddb9de

Browse files
jhovoldVudentz
authored andcommitted
Bluetooth: qca: fix NULL-deref on non-serdev setup
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 setup() is called for a non-serdev controller. Fixes: e9b3e5b ("Bluetooth: hci_qca: only assign wakeup with serial port support") Cc: [email protected] # 6.2 Cc: Zhengping Jiang <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 73e87c0 commit 7ddb9de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,8 +1958,10 @@ static int qca_setup(struct hci_uart *hu)
19581958
qca_debugfs_init(hdev);
19591959
hu->hdev->hw_error = qca_hw_error;
19601960
hu->hdev->cmd_timeout = qca_cmd_timeout;
1961-
if (device_can_wakeup(hu->serdev->ctrl->dev.parent))
1962-
hu->hdev->wakeup = qca_wakeup;
1961+
if (hu->serdev) {
1962+
if (device_can_wakeup(hu->serdev->ctrl->dev.parent))
1963+
hu->hdev->wakeup = qca_wakeup;
1964+
}
19631965
} else if (ret == -ENOENT) {
19641966
/* No patch/nvm-config found, run with original fw/config */
19651967
set_bit(QCA_ROM_FW, &qca->flags);

0 commit comments

Comments
 (0)