]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: lan78xx: fix transfer-buffer memory leak
authorJohan Hovold <johan@kernel.org>
Tue, 28 Jul 2020 12:10:30 +0000 (14:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Jul 2020 20:35:44 +0000 (13:35 -0700)
The interrupt URB transfer-buffer was never freed on disconnect or after
probe errors.

Fixes: f98af78833e9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
Cc: Woojung.Huh@microchip.com <Woojung.Huh@microchip.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/lan78xx.c

index d7162690e3f3d5bdf302dd51479d44ae814f6a9e..ee062b27cfa7bbebbd105773a79ad492b8ab9867 100644 (file)
@@ -3788,6 +3788,7 @@ static int lan78xx_probe(struct usb_interface *intf,
                        usb_fill_int_urb(dev->urb_intr, dev->udev,
                                         dev->pipe_intr, buf, maxp,
                                         intr_complete, dev, period);
+                       dev->urb_intr->transfer_flags |= URB_FREE_BUFFER;
                }
        }