From: Lukas Wunner Date: Wed, 10 Jan 2018 15:32:10 +0000 (+0100) Subject: Bluetooth: hci_bcm: Fix unbalanced pm_runtime_disable() X-Git-Tag: v4.16-rc1~123^2~177^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4cf6b7e3b8704d3dabfb8427a61d4c03ce48d80;p=thirdparty%2Fkernel%2Flinux.git Bluetooth: hci_bcm: Fix unbalanced pm_runtime_disable() On ->setup, pm_runtime_enable() is only called if a valid IRQ was found, but on ->close(), pm_runtime_disable() is called unconditionally. Disablement of runtime PM is recorded in a counter, so every pm_runtime_disable() needs to be balanced. Fix it. Cc: Frédéric Danis Reported-and-reviewed-by: Andy Shevchenko Signed-off-by: Lukas Wunner Signed-off-by: Marcel Holtmann --- diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 6144a3f9c37a6..140c7e5bf812a 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -375,10 +375,10 @@ static int bcm_close(struct hci_uart *hu) if (IS_ENABLED(CONFIG_PM) && bdev->irq > 0) { devm_free_irq(bdev->dev, bdev->irq, bdev); device_init_wakeup(bdev->dev, false); + pm_runtime_disable(bdev->dev); } bcm_gpio_set_power(bdev, false); - pm_runtime_disable(bdev->dev); pm_runtime_set_suspended(bdev->dev); } mutex_unlock(&bcm_device_lock);