Skip to content

Commit 02f9da8

Browse files
rtkbt-maxgregkh
authored andcommitted
Bluetooth: btrtl: check for NULL in btrtl_setup_realtek()
[ Upstream commit 3c15082 ] If insert an USB dongle which chip is not maintained in ic_id_table, it will hit the NULL point accessed. Add a null point check to avoid the Kernel Oops. Fixes: b39910b ("Bluetooth: Populate hci_set_hw_info for Intel and Realtek") Reviewed-by: Alex Lu <alex_lu@realsil.com.cn> Signed-off-by: Max Chou <max.chou@realtek.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 74af8b9 commit 02f9da8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/bluetooth/btrtl.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1351,12 +1351,14 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
13511351

13521352
btrtl_set_quirks(hdev, btrtl_dev);
13531353

1354-
hci_set_hw_info(hdev,
1354+
if (btrtl_dev->ic_info) {
1355+
hci_set_hw_info(hdev,
13551356
"RTL lmp_subver=%u hci_rev=%u hci_ver=%u hci_bus=%u",
13561357
btrtl_dev->ic_info->lmp_subver,
13571358
btrtl_dev->ic_info->hci_rev,
13581359
btrtl_dev->ic_info->hci_ver,
13591360
btrtl_dev->ic_info->hci_bus);
1361+
}
13601362

13611363
btrtl_free(btrtl_dev);
13621364
return ret;

0 commit comments

Comments
 (0)