aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2009-11-13 08:26:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-11-14 15:57:08 -0500
commit7b8e2c1db0f358bc389dd1ee4633a92d80a5a6d0 (patch)
tree0e24795c1f0794ed2920e9f25c754d5bce39de44 /drivers/bluetooth
parent479c2553af9a176a0613894b9f1ec73425fd56a3 (diff)
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 2fb38027f3b..44bc8bbabf5 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -600,11 +600,13 @@ static int btusb_close(struct hci_dev *hdev)
600 btusb_stop_traffic(data); 600 btusb_stop_traffic(data);
601 err = usb_autopm_get_interface(data->intf); 601 err = usb_autopm_get_interface(data->intf);
602 if (err < 0) 602 if (err < 0)
603 return 0; 603 goto failed;
604 604
605 data->intf->needs_remote_wakeup = 0; 605 data->intf->needs_remote_wakeup = 0;
606 usb_autopm_put_interface(data->intf); 606 usb_autopm_put_interface(data->intf);
607 607
608failed:
609 usb_scuttle_anchored_urbs(&data->deferred);
608 return 0; 610 return 0;
609} 611}
610 612