Commit ab60707f authored by Jesper Juhl's avatar Jesper Juhl Committed by David S. Miller

USB Network driver infrastructure: Fix leak when usb_autopm_get_interface()...

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: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d3337de5
...@@ -931,8 +931,10 @@ kevent (struct work_struct *work) ...@@ -931,8 +931,10 @@ kevent (struct work_struct *work)
if (urb != NULL) { if (urb != NULL) {
clear_bit (EVENT_RX_MEMORY, &dev->flags); clear_bit (EVENT_RX_MEMORY, &dev->flags);
status = usb_autopm_get_interface(dev->intf); status = usb_autopm_get_interface(dev->intf);
if (status < 0) if (status < 0) {
usb_free_urb(urb);
goto fail_lowmem; goto fail_lowmem;
}
if (rx_submit (dev, urb, GFP_KERNEL) == -ENOLINK) if (rx_submit (dev, urb, GFP_KERNEL) == -ENOLINK)
resched = 0; resched = 0;
usb_autopm_put_interface(dev->intf); usb_autopm_put_interface(dev->intf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment