From: Oliver Neukum Date: Fri, 13 Nov 2009 13:26:23 +0000 (+0100) Subject: fix memory leak in fixed btusb_close X-Git-Tag: v2.6.32-rc8~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b8e2c1db0f358bc389dd1ee4633a92d80a5a6d0;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Acked-by: Marcel Holtmann Signed-off-by: Linus Torvalds --- diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 2fb3802..44bc8bb 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; }