Commit 8bfa7e1e03ac ("Bluetooth: hci_bcm: Handle errors properly") introduced error checking for the bcm_gpio_set_power() call in bcm_open() but the error-path it introduces does not properly call serdev_device_close() to undo the earlier serdev_device_open(), this commit fixes this. Cc: Lukas Wunner <lukas@xxxxxxxxx> Fixes: 8bfa7e1e03ac ("Bluetooth: hci_bcm: Handle errors properly") Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> --- drivers/bluetooth/hci_bcm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 61f73cc4c05e..da4736f2e913 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -336,11 +336,13 @@ static int bcm_open(struct hci_uart *hu) hu->oper_speed = bdev->oper_speed; err = bcm_gpio_set_power(bdev, true); if (err) - goto err_free; + goto err_close_serdev; } return 0; +err_close_serdev: + serdev_device_close(hu->serdev); err_free: hu->priv = NULL; kfree(bcm); -- 2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html