mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
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>
This commit is contained in:
parent
70f8002d78
commit
720f3d7cb1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user