Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usbnet: Fix memory leak in usbnet_disconnect()
Currently usbnet_disconnect() unanchors and frees all deferred URBs using usb_scuttle_anchored_urbs(), which does not free urb->context, causing a memory leak as reported by syzbot. Use a usb_get_from_anchor() while loop instead, similar to what we did in commit 19cfe91 ("Bluetooth: btusb: Fix memory leak in play_deferred"). Also free urb->sg. Reported-and-tested-by: [email protected] Fixes: 69ee472 ("usbnet & cdc-ether: Autosuspend for online devices") Fixes: 638c511 ("USBNET: support DMA SG") Signed-off-by: Peilin Ye <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
- Loading branch information