summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorMax Chou <max.chou@realtek.com>2023-03-21 19:48:26 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-04-23 21:57:00 -0700
commit253cf30e8d3d001850a95c4729d668f916b037ab (patch)
tree89ee194bcca0e64573881543af6a7c23534df749 /drivers/bluetooth
parent069f534247bb6db4f8c2c2ea8e9155abf495c37e (diff)
downloadlinux-stable-253cf30e8d3d001850a95c4729d668f916b037ab.tar.gz
linux-stable-253cf30e8d3d001850a95c4729d668f916b037ab.tar.bz2
linux-stable-253cf30e8d3d001850a95c4729d668f916b037ab.zip
Bluetooth: btrtl: check for NULL in btrtl_set_quirks()
The btrtl_set_quirks() has accessed btrtl_dev->ic_info->lmp_subver since b8e482d02513. However, if installing a Realtek Bluetooth controller without the driver supported, it will hit the NULL point accessed. Add a check for NULL to avoid the Kernel Oops. Signed-off-by: Max Chou <max.chou@realtek.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btrtl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 8fa7733812ad..0f256a8abef4 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -905,6 +905,9 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
break;
}
+ if (!btrtl_dev->ic_info)
+ return;
+
switch (btrtl_dev->ic_info->lmp_subver) {
case RTL_ROM_LMP_8703B:
/* 8723CS reports two pages for local ext features,