From: Zijun Hu <quic_zijuhu@quicinc.com>
To: <luiz.dentz@gmail.com>, <marcel@holtmann.org>, <johan.hedberg@gmail.com>
Cc: <linux-bluetooth@vger.kernel.org>, <quic_zijuhu@quicinc.com>
Subject: [PATCH v4 1/2] Bluetooth: hci_conn: Check non NULL function before calling for HFP offload
Date: Fri, 8 Dec 2023 09:51:26 +0800 [thread overview]
Message-ID: <1702000287-22538-2-git-send-email-quic_zijuhu@quicinc.com> (raw)
In-Reply-To: <1702000287-22538-1-git-send-email-quic_zijuhu@quicinc.com>
For some controllers such as QCA2066, it does not need to send
HCI_Configure_Data_Path to configure non-HCI data transport path to support
HFP offload, their device drivers may set hdev->get_codec_config_data as
NULL, so Explicitly add this non NULL checking before calling the function.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
net/bluetooth/hci_conn.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index a09071059214..0b757c3a7331 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -300,6 +300,10 @@ static int configure_datapath_sync(struct hci_dev *hdev, struct bt_codec *codec)
__u8 vnd_len, *vnd_data = NULL;
struct hci_op_configure_data_path *cmd = NULL;
+ /* Do not take me as error */
+ if (!hdev->get_codec_config_data)
+ return 0;
+
err = hdev->get_codec_config_data(hdev, ESCO_LINK, codec, &vnd_len,
&vnd_data);
if (err < 0)
--
The Qualcomm Innovation Center
next prev parent reply other threads:[~2023-12-08 1:53 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 6:19 [PATCH v1 0/2] Bluetooth: Support SCO offload for QCA2066 Zijun Hu
2023-11-06 6:19 ` [PATCH v1 1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() Zijun Hu
2023-11-06 7:00 ` Bluetooth: Support SCO offload for QCA2066 bluez.test.bot
2023-11-06 6:19 ` [PATCH v1 2/2] Bluetooth: qca: " Zijun Hu
2023-11-29 7:07 ` [PATCH v2 " Zijun Hu
2023-11-06 16:16 ` [PATCH v1 0/2] Bluetooth: " Luiz Augusto von Dentz
2023-11-07 2:46 ` quic_zijuhu
2023-11-17 16:02 ` Luiz Augusto von Dentz
2023-11-29 3:29 ` quic_zijuhu
2023-12-07 21:59 ` quic_zijuhu
2023-11-29 8:07 ` [PATCH v2 " Zijun Hu
2023-11-29 8:07 ` [PATCH v2 1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() Zijun Hu
2023-11-29 8:35 ` Bluetooth: Support SCO offload for QCA2066 bluez.test.bot
2023-11-29 8:07 ` [PATCH v2 2/2] Bluetooth: qca: " Zijun Hu
2023-11-29 8:18 ` [PATCH v2 0/2] Bluetooth: " Zijun Hu
2023-11-29 8:18 ` [PATCH v2 1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() Zijun Hu
2023-11-29 8:58 ` [v2,1/2] " bluez.test.bot
2023-11-29 8:18 ` [PATCH v2 2/2] Bluetooth: qca: Support SCO offload for QCA2066 Zijun Hu
2023-11-29 8:29 ` [PATCH v3 0/2] Bluetooth: " Zijun Hu
2023-11-29 8:29 ` [PATCH v3 1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() Zijun Hu
2023-11-29 8:57 ` Bluetooth: Support SCO offload for QCA2066 bluez.test.bot
2023-11-29 8:29 ` [PATCH v3 2/2] Bluetooth: qca: " Zijun Hu
2023-12-08 1:51 ` [PATCH v4 0/2] Bluetooth: " Zijun Hu
2023-12-08 1:51 ` Zijun Hu [this message]
2023-12-08 2:47 ` bluez.test.bot
2023-12-08 1:51 ` [PATCH v4 2/2] Bluetooth: qca: Support HFP " Zijun Hu
2023-12-08 15:10 ` [PATCH v4 0/2] Bluetooth: Support SCO " patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1702000287-22538-2-git-send-email-quic_zijuhu@quicinc.com \
--to=quic_zijuhu@quicinc.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).