diff options
author | Oliver Neukum <oneukum@suse.com> | 2019-11-14 18:01:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-09 12:19:04 +0300 |
commit | a0a5f3d36b04d53acb351e898adced3f199d79ec (patch) | |
tree | b2194a71e978e82d5cbfd3386f88cb3fdceb8050 /drivers/bluetooth | |
parent | b1ecf978fadf406b5ab3cecc08cffe8feb194980 (diff) | |
download | linux-a0a5f3d36b04d53acb351e898adced3f199d79ec.tar.xz |
Bluetooth: btusb: fix PM leak in error case of setup
commit 3d44a6fd0775e6215e836423e27f8eedf8c871ea upstream.
If setup() fails a reference for runtime PM has already
been taken. Proper use of the error handling in btusb_open()is needed.
You cannot just return.
Fixes: ace31982585a3 ("Bluetooth: btusb: Add setup callback for chip init on USB")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/btusb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 08936bf696d3..1b0adf5c2376 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -1138,7 +1138,7 @@ static int btusb_open(struct hci_dev *hdev) if (data->setup_on_usb) { err = data->setup_on_usb(hdev); if (err < 0) - return err; + goto setup_fail; } data->intf->needs_remote_wakeup = 1; @@ -1170,6 +1170,7 @@ done: failed: clear_bit(BTUSB_INTR_RUNNING, &data->flags); +setup_fail: usb_autopm_put_interface(data->intf); return err; } |