staging: r8188eu: Fix skb leak in usb_read_port_complete()
authorLarry Finger <Larry.Finger@lwfinger.net>
Mon, 7 Oct 2013 15:10:55 +0000 (10:10 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Oct 2013 01:59:55 +0000 (18:59 -0700)
In the completion routine for a usb_fill_bulk_urb() call, an skb is
leaked whenever the status of the USB transaction is not zero. A call
to skb_put() is needed to fix the problem.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/usb_ops_linux.c

index 2a20f2348108058f39c033700f7023f5fc570091..787763ef74c6707d832c34edf0e8ed443cdb3543 100644 (file)
@@ -547,6 +547,8 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
                RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete : purb->status(%d) != 0\n", purb->status));
 
                DBG_88E("###=> usb_read_port_complete => urb status(%d)\n", purb->status);
+               skb_put(precvbuf->pskb, purb->actual_length);
+               precvbuf->pskb = NULL;
 
                if (rtw_inc_and_chk_continual_urb_error(adapter_to_dvobj(adapt)))
                        adapt->bSurpriseRemoved = true;