diff mbox series

[v2,1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data()

Message ID 1701245906-10660-2-git-send-email-quic_zijuhu@quicinc.com
State Superseded
Headers show
Series [v2,1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() | expand

Commit Message

quic_zijuhu Nov. 29, 2023, 8:18 a.m. UTC
Explicitly add non NULL checking before calling
hdev->get_codec_config_data().

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 net/bluetooth/hci_conn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index a09071059214..21b59d674717 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -346,7 +346,7 @@  static int hci_enhanced_setup_sync(struct hci_dev *hdev, void *data)
 	bt_dev_dbg(hdev, "hcon %p", conn);
 
 	/* for offload use case, codec needs to configured before opening SCO */
-	if (conn->codec.data_path)
+	if (conn->codec.data_path && hdev->get_codec_config_data)
 		configure_datapath_sync(hdev, &conn->codec);
 
 	conn->state = BT_CONNECT;