2020-05-20 16:34:54

by Abhishek Pandit-Subedi

[permalink] [raw]
Subject: [PATCH] Bluetooth: hci_qca: Fix uninitialized access to hdev

hdev is always allocated and not only when power control is required.

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Abhishek Pandit-Subedi <[email protected]>
---

drivers/bluetooth/hci_qca.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 26efe822f6e58..e4a68238fcb93 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1947,8 +1947,9 @@ static int qca_serdev_probe(struct serdev_device *serdev)
}
}

+ hdev = qcadev->serdev_hu.hdev;
+
if (power_ctrl_enabled) {
- hdev = qcadev->serdev_hu.hdev;
set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks);
hdev->shutdown = qca_power_off;
}
--
2.27.0.rc0.183.gde8f92d652-goog


2020-05-20 17:14:22

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci_qca: Fix uninitialized access to hdev

Hi Abhishek,

> hdev is always allocated and not only when power control is required.
>
> Reported-by: Dan Carpenter <[email protected]>
> Signed-off-by: Abhishek Pandit-Subedi <[email protected]>
> ---
>
> drivers/bluetooth/hci_qca.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel