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 коммит произвёл Marcel Holtmann
Родитель 755dfcbca8
Коммит 85e90d9391
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

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