]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: hci_qca: Fix crash with non-serdev devices
authorMatthias Kaehlcke <mka@chromium.org>
Tue, 23 Apr 2019 18:16:52 +0000 (11:16 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 23 Apr 2019 19:38:06 +0000 (21:38 +0200)
commit06306a4c4d3676081d5d0beb4dc48e63624cb6b9
tree3d44e6e3d300580f04208d7dd4f7de8c2c327293
parent32268e96d57744ca0b603243a88acef819788e14
Bluetooth: hci_qca: Fix crash with non-serdev devices

qca_set_baudrate() calls serdev_device_wait_until_sent() assuming that
the HCI is always associated with a serdev device. This isn't true for
ROME controllers instantiated through ldisc, where the call causes a
crash due to a NULL pointer dereferentiation. Only call the function
when we have a serdev device. The timeout for ROME devices at the end
of qca_set_baudrate() is long enough to be reasonably sure that the
command was sent.

Fixes: 54618969cea1 ("Bluetooth: hci_qca: Add support for Qualcomm Bluetooth chip wcn3990")
Reported-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
Reported-by: Rocky Liao <rjliao@codeaurora.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Rocky Liao <rjliao@codeaurora.org>
Tested-by: Rocky Liao <rjliao@codeaurora.org>
Reviewed-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_qca.c