Re: [PATCH v2] Bluetooth: hci_qca: Add helper function to get the chip family

From: Marcel Holtmann
Date: Mon Mar 11 2019 - 14:54:53 EST


Hi Matthias,

> 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: fa9ad876b8e0 ("Bluetooth: hci_qca: Add support for Qualcomm Bluetooth chip wcn3990")
> Reported-by: Balakrishna Godavarthi <bgodavar@xxxxxxxxxxxxxx>
> Signed-off-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx>
> ---
> Changes in v2:
> - make ROME the default type for non-serdev platforms
> ---
> drivers/bluetooth/hci_qca.c | 45 +++++++++++++++++++++----------------
> 1 file changed, 26 insertions(+), 19 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel