summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2009-11-13 14:26:23 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-11-14 12:57:08 -0800
commit7b8e2c1db0f358bc389dd1ee4633a92d80a5a6d0 (patch)
tree0e24795c1f0794ed2920e9f25c754d5bce39de44 /drivers/bluetooth
parent479c2553af9a176a0613894b9f1ec73425fd56a3 (diff)
downloadblackbird-op-linux-7b8e2c1db0f358bc389dd1ee4633a92d80a5a6d0.tar.gz
blackbird-op-linux-7b8e2c1db0f358bc389dd1ee4633a92d80a5a6d0.zip
fix memory leak in fixed btusb_close
If the waker is killed before it can replay outstanding URBs, these URBs won't be freed or will be replayed at the next open. This patch closes the window by explicitely discarding outstanding URBs. Signed-off-by: Oliver Neukum <oliver@neukum.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btusb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 2fb38027f3bb..44bc8bbabf54 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -600,11 +600,13 @@ static int btusb_close(struct hci_dev *hdev)
btusb_stop_traffic(data);
err = usb_autopm_get_interface(data->intf);
if (err < 0)
- return 0;
+ goto failed;
data->intf->needs_remote_wakeup = 0;
usb_autopm_put_interface(data->intf);
+failed:
+ usb_scuttle_anchored_urbs(&data->deferred);
return 0;
}
OpenPOWER on IntegriCloud