Commit feac90d7 authored by Zijun Hu's avatar Zijun Hu Committed by Marcel Holtmann
Browse files

Bluetooth: hci_qca: Fix suspend/resume functionality failure



@dev parameter of qca_suspend()/qca_resume() represents
serdev_device, but it is mistook for hci_dev and causes
succedent unexpected memory access.

Fix by taking @dev as serdev_device.

Fixes: 41d5b25f ("Bluetooth: hci_qca: add PM support")
Signed-off-by: default avatarZijun Hu <zijuhu@codeaurora.org>
Reviewed-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent bf0ddd10
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1977,8 +1977,9 @@ static void qca_serdev_remove(struct serdev_device *serdev)

static int __maybe_unused qca_suspend(struct device *dev)
{
	struct hci_dev *hdev = container_of(dev, struct hci_dev, dev);
	struct hci_uart *hu = hci_get_drvdata(hdev);
	struct serdev_device *serdev = to_serdev_device(dev);
	struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
	struct hci_uart *hu = &qcadev->serdev_hu;
	struct qca_data *qca = hu->priv;
	unsigned long flags;
	int ret = 0;
@@ -2057,8 +2058,9 @@ error:

static int __maybe_unused qca_resume(struct device *dev)
{
	struct hci_dev *hdev = container_of(dev, struct hci_dev, dev);
	struct hci_uart *hu = hci_get_drvdata(hdev);
	struct serdev_device *serdev = to_serdev_device(dev);
	struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
	struct hci_uart *hu = &qcadev->serdev_hu;
	struct qca_data *qca = hu->priv;

	clear_bit(QCA_SUSPENDING, &qca->flags);