Bluetooth: hci_qca: Fix uninitialized access to hdev

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>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
Abhishek Pandit-Subedi 2020-05-20 09:32:28 -07:00 committed by Marcel Holtmann
parent 755dfcbca8
commit 85e90d9391

View File

@ -1947,8 +1947,9 @@ static int qca_serdev_probe(struct serdev_device *serdev)
} }
} }
hdev = qcadev->serdev_hu.hdev;
if (power_ctrl_enabled) { if (power_ctrl_enabled) {
hdev = qcadev->serdev_hu.hdev;
set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks);
hdev->shutdown = qca_power_off; hdev->shutdown = qca_power_off;
} }