From: tom.leiming@gmail.com Date: Sun, 29 Apr 2012 22:51:02 +0000 (+0000) Subject: usbnet: fix leak of transfer buffer of dev->interrupt X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=720f3d7cb19eb27f85f72836c8f8004ccb257f39;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git usbnet: fix leak of transfer buffer of dev->interrupt The transfer buffer of dev->interrupt is allocated in .probe path, but not freed in .disconnet path, so mark the interrupt URB as URB_FREE_BUFFER to free the buffer when the URB is destroyed. Signed-off-by: Ming Lei Acked-by: Oliver Neukum Signed-off-by: David S. Miller --- diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index b7b3f5b0d406..ca6fd80c2b40 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -210,6 +210,7 @@ static int init_status (struct usbnet *dev, struct usb_interface *intf) } else { usb_fill_int_urb(dev->interrupt, dev->udev, pipe, buf, maxp, intr_complete, dev, period); + dev->interrupt->transfer_flags |= URB_FREE_BUFFER; dev_dbg(&intf->dev, "status ep%din, %d bytes period %d\n", usb_pipeendpoint(pipe), maxp, period);