public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Marcel Holtmann <marcel@holtmann.org>,
	Gustavo Padovan <gustavo@padovan.org>,
	Johan Hedberg <johan.hedberg@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	linux-bluetooth@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-acpi@vger.kernel.org, Lukas Wunner <lukas@wunner.de>
Subject: [PATCH 2/2] Bluetooth: hci_bcm: Close serdev on failure to set power on bcm_open()
Date: Sun, 21 Jan 2018 22:46:45 +0100	[thread overview]
Message-ID: <20180121214645.15004-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20180121214645.15004-1-hdegoede@redhat.com>

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@wunner.de>
Fixes: 8bfa7e1e03ac ("Bluetooth: hci_bcm: Handle errors properly")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 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


  reply	other threads:[~2018-01-21 21:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-21 21:46 [PATCH 1/2] Bluetooth: hci_bcm: Remove platform_device support Hans de Goede
2018-01-21 21:46 ` Hans de Goede [this message]
2018-01-22  2:20   ` [PATCH 2/2] Bluetooth: hci_bcm: Close serdev on failure to set power on bcm_open() Marcel Holtmann
2018-01-22  2:24 ` [PATCH 1/2] Bluetooth: hci_bcm: Remove platform_device support Marcel Holtmann
2018-01-22  8:23   ` Hans de Goede
2018-01-22  9:42     ` Andy Shevchenko
     [not found]       ` <1516614127.7000.1152.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2018-01-22 11:27         ` Hans de Goede
2018-01-22 11:33           ` Andy Shevchenko
2018-01-22 11:49             ` Hans de Goede
     [not found]               ` <0cae9024-887a-45f7-7710-1684f9c0e54e-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-22 12:01                 ` Marcel Holtmann
2018-01-22 12:15                   ` Andy Shevchenko
2018-01-23 23:49                     ` Ferry Toth
2018-01-22 19:57                 ` Marcel Holtmann
2018-01-22 20:56                   ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180121214645.15004-2-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox