Patch "Bluetooth: btrtl: check for NULL in btrtl_set_quirks()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Bluetooth: btrtl: check for NULL in btrtl_set_quirks()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bluetooth-btrtl-check-for-null-in-btrtl_set_quirks.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a6f36e35e162346f7978a4558f67f905c6361358
Author: Max Chou <max.chou@xxxxxxxxxxx>
Date:   Tue Mar 21 19:48:26 2023 +0800

    Bluetooth: btrtl: check for NULL in btrtl_set_quirks()
    
    [ Upstream commit 253cf30e8d3d001850a95c4729d668f916b037ab ]
    
    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@xxxxxxxxxxx>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 6b3755345427a..88f8c604d70a2 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -882,6 +882,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,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux