summaryrefslogtreecommitdiff
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorMax Chou <max.chou@realtek.com>2024-12-31 14:57:19 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 09:57:23 +0100
commit1158ad8e8abb361d4b2aaa010c9af74de20ab82b (patch)
tree8fa16c2fb3ea4cb0d3b066fbceb99ae8bb30b73c /drivers/bluetooth
parentdf2f2d9199e61819cca5da0121dfa4d4cb57000f (diff)
downloadlinux-1158ad8e8abb361d4b2aaa010c9af74de20ab82b.tar.gz
linux-1158ad8e8abb361d4b2aaa010c9af74de20ab82b.tar.bz2
linux-1158ad8e8abb361d4b2aaa010c9af74de20ab82b.zip
Bluetooth: btrtl: check for NULL in btrtl_setup_realtek()
[ Upstream commit 3c15082f3567032d196e8760753373332508c2ca ] 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: b39910bb54d9 ("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>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btrtl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 0bcb44cf7b31..0a6ca6dfb948 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -1351,12 +1351,14 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
btrtl_set_quirks(hdev, btrtl_dev);
- hci_set_hw_info(hdev,
+ if (btrtl_dev->ic_info) {
+ hci_set_hw_info(hdev,
"RTL lmp_subver=%u hci_rev=%u hci_ver=%u hci_bus=%u",
btrtl_dev->ic_info->lmp_subver,
btrtl_dev->ic_info->hci_rev,
btrtl_dev->ic_info->hci_ver,
btrtl_dev->ic_info->hci_bus);
+ }
btrtl_free(btrtl_dev);
return ret;