summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/usbnet.c
diff options
context:
space:
mode:
authortom.leiming@gmail.com <tom.leiming@gmail.com>2012-04-30 00:51:02 +0200
committerDavid S. Miller <davem@davemloft.net>2012-05-03 02:13:03 +0200
commit720f3d7cb19eb27f85f72836c8f8004ccb257f39 (patch)
treeb3299b0dfb37f0a4c495871b7907bf5b8d0101bd /drivers/net/usb/usbnet.c
parentucc_geth: Add 16 bytes to max TX frame for VLANs (diff)
downloadlinux-720f3d7cb19eb27f85f72836c8f8004ccb257f39.tar.xz
linux-720f3d7cb19eb27f85f72836c8f8004ccb257f39.zip
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 <tom.leiming@gmail.com> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/usb/usbnet.c1
1 files changed, 1 insertions, 0 deletions
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);