diff options
author | Jesper Juhl <jj@chaosbits.net> | 2011-02-10 11:58:45 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-13 20:21:15 +0100 |
commit | ab60707ffe9920b66b4fff5181b44b14cd091472 (patch) | |
tree | d0baa22dfe87b87b0188ac0305d05fa7454a5c3c /drivers/net/usb | |
parent | Don't potentially dereference NULL in net/dcb/dcbnl.c:dcbnl_getapp() (diff) | |
download | linux-ab60707ffe9920b66b4fff5181b44b14cd091472.tar.xz linux-ab60707ffe9920b66b4fff5181b44b14cd091472.zip |
USB Network driver infrastructure: Fix leak when usb_autopm_get_interface() returns less than zero in kevent().
We'll leak the memory allocated to 'urb' in
drivers/net/usb/usbnet.c:kevent() when we 'goto fail_lowmem' and the 'urb'
variable goes out of scope while still completely unused.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/usbnet.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index ed9a41643ff4..95c41d56631c 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -931,8 +931,10 @@ fail_halt: if (urb != NULL) { clear_bit (EVENT_RX_MEMORY, &dev->flags); status = usb_autopm_get_interface(dev->intf); - if (status < 0) + if (status < 0) { + usb_free_urb(urb); goto fail_lowmem; + } if (rx_submit (dev, urb, GFP_KERNEL) == -ENOLINK) resched = 0; usb_autopm_put_interface(dev->intf); |