Skip to content

Commit

Permalink
fix memory leak in fixed btusb_close
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oliver Neukum authored and Linus Torvalds committed Nov 14, 2009
1 parent 479c255 commit 7b8e2c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7b8e2c1

Please sign in to comment.