]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: hci_qca: Add helper function to get the chip family
authorMatthias Kaehlcke <mka@chromium.org>
Mon, 11 Mar 2019 18:38:31 +0000 (11:38 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 23 Apr 2019 16:09:07 +0000 (18:09 +0200)
commita2652ed1b467b144f21a6d1577c3fb196cfcbba0
treeca09ef8d7b5514ac0ea040f8ceae93bf0ebd6429
parent706dc795574b270e1b30eb41bb75b5b0563f28c0
Bluetooth: hci_qca: Add helper function to get the chip family

Many functions obtain a 'struct qca_serdev' only to read the btsoc_type
field. Add a helper function that encapsulates this.

This also fixes crashes observed on platforms with ROME controllers
that are instantiated through ldisc and not as serdev clients. The
crashes are caused by NULL pointer dereferentiations, which stem from
the driver's assumption that a QCA HCI device is always associated with
a serdev device.

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