Skip to content

Commit

Permalink
Bluetooth: hci_qca: Fix uninitialized access to hdev
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Abhishek Pandit-Subedi authored and Marcel Holtmann committed May 20, 2020
1 parent 755dfcb commit 85e90d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/bluetooth/hci_qca.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 85e90d9

Please sign in to comment.