diff options
author | Lukas Wunner <lukas@wunner.de> | 2018-01-10 18:32:10 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2018-01-10 21:00:13 +0300 |
commit | 4dc273306c16b04f696e8ab0e8bb4f6e238fe61b (patch) | |
tree | 388fcae80cf980512061b162e37004520a6d114a /drivers/bluetooth/hci_bcm.c | |
parent | f4cf6b7e3b8704d3dabfb8427a61d4c03ce48d80 (diff) | |
download | linux-4dc273306c16b04f696e8ab0e8bb4f6e238fe61b.tar.xz |
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/hci_bcm.c')
-rw-r--r-- | drivers/bluetooth/hci_bcm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 140c7e5bf812..c893c597fead 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -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); |