Skip to content

Commit 253cf30

Browse files
rtkbt-maxVudentz
authored andcommitted
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 <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 069f534 commit 253cf30

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/bluetooth/btrtl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,9 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
905905
break;
906906
}
907907

908+
if (!btrtl_dev->ic_info)
909+
return;
910+
908911
switch (btrtl_dev->ic_info->lmp_subver) {
909912
case RTL_ROM_LMP_8703B:
910913
/* 8723CS reports two pages for local ext features,

0 commit comments

Comments
 (0)