Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4dc27330 authored by Lukas Wunner's avatar Lukas Wunner Committed by Marcel Holtmann
Browse files

Bluetooth: hci_bcm: Invalidate IRQ on request failure



If devm_request_irq() fails, the driver bails out of bcm_request_irq()
but continues to ->setup the device (because the IRQ is optional).

The driver subsequently calls devm_free_irq(), enable_irq_wake() and
disable_irq_wake() on the IRQ even though requesting it failed.

Avoid by invalidating the IRQ on request failure.

Cc: Frédéric Danis <frederic.danis.oss@gmail.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent f4cf6b7e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -216,8 +216,10 @@ static int bcm_request_irq(struct bcm_data *bcm)
			       bdev->irq_active_low ? IRQF_TRIGGER_FALLING :
						      IRQF_TRIGGER_RISING,
			       "host_wake", bdev);
	if (err)
	if (err) {
		bdev->irq = err;
		goto unlock;
	}

	device_init_wakeup(bdev->dev, true);