mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
Bluetooth: btusb: fix PM leak in error case of setup
commit3d44a6fd07upstream. 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:ace3198258("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>
This commit is contained in:
@@ -1069,7 +1069,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;
|
||||
@@ -1101,6 +1101,7 @@ done:
|
||||
|
||||
failed:
|
||||
clear_bit(BTUSB_INTR_RUNNING, &data->flags);
|
||||
setup_fail:
|
||||
usb_autopm_put_interface(data->intf);
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user