Re: [PATCH v3 09/13] Bluetooth: hci_bcm: Handle errors properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 07, 2018 at 08:16:32PM +0100, Lukas Wunner wrote:
> @@ -406,8 +440,10 @@ static int bcm_close(struct hci_uart *hu)
>  			device_init_wakeup(bdev->dev, false);
>  		}
>  
> -		bcm_gpio_set_power(bdev, false);
> -		if (bdev->irq > 0) {
> +		err = bcm_gpio_set_power(bdev, false);
> +		if (err) {
> +			bt_dev_err(hu->hdev, "Failed to power down");
> +		} else if (bdev->irq > 0) {
>  			pm_runtime_disable(bdev->dev);
>  			pm_runtime_set_suspended(bdev->dev);
>  		}

Hm, I realize I've botched this (again):  If a valid IRQ was found
but bcm_gpio_set_power() fails here, then the pm_runtime_enable()
in bcm_request_irq() isn't balanced. :-(

So pm_runtime_disable() needs to be called even if err != 0
(but only if bdev->irq > 0).

Lukas
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux