Bluetooth: hci_qca: Fix uninitialized access to hdev
diff mbox series

Message ID 20200520093206.1.I1a56163c173e14d1cc7a8b639147466171525eab@changeid
State In Next
Commit 85e90d9391f57436b6f7f00503de370a657420ba
Headers show
Series
  • Bluetooth: hci_qca: Fix uninitialized access to hdev
Related show

Commit Message

Abhishek Pandit-Subedi May 20, 2020, 4:32 p.m. UTC
hdev is always allocated and not only when power control is required.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
---

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

Comments

Marcel Holtmann May 20, 2020, 5:13 p.m. UTC | #1
Hi Abhishek,

> hdev is always allocated and not only when power control is required.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> ---
> 
> drivers/bluetooth/hci_qca.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

Patch
diff mbox series

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;
 	}