Skip to content

Commit

Permalink
libertas: Fix memory leak of RX skbs
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
David Woodhouse authored and David S. Miller committed Jan 28, 2008
1 parent 38d1b4c commit 77d8cf2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/wireless/libertas/if_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ static int __if_usb_submit_rx_urb(struct usb_card_rec *cardp,
if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) {
/* handle failure conditions */
lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB failed\n");
kfree_skb(skb);
rinfo->skb = NULL;
ret = -1;
} else {
/* lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB success\n"); */
Expand Down Expand Up @@ -667,8 +669,10 @@ static void if_usb_receive(struct urb *urb)
lbs_deb_usbd(&cardp->udev->dev,
"Recv length = 0x%x, Recv type = 0x%X\n",
recvlength, recvtype);
} else if (urb->status)
} else if (urb->status) {
kfree_skb(skb);
goto rx_exit;
}

switch (recvtype) {
case CMD_TYPE_DATA:
Expand Down

0 comments on commit 77d8cf2

Please sign in to comment.