libertas: Fix memory leak of RX skbs
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
David S. Miller
parent
38d1b4ce90
commit
77d8cf2c09
@@ -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))) {
|
if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) {
|
||||||
/* handle failure conditions */
|
/* handle failure conditions */
|
||||||
lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB failed\n");
|
lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB failed\n");
|
||||||
|
kfree_skb(skb);
|
||||||
|
rinfo->skb = NULL;
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else {
|
} else {
|
||||||
/* lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB success\n"); */
|
/* lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB success\n"); */
|
||||||
@@ -667,8 +669,10 @@ static void if_usb_receive(struct urb *urb)
|
|||||||
lbs_deb_usbd(&cardp->udev->dev,
|
lbs_deb_usbd(&cardp->udev->dev,
|
||||||
"Recv length = 0x%x, Recv type = 0x%X\n",
|
"Recv length = 0x%x, Recv type = 0x%X\n",
|
||||||
recvlength, recvtype);
|
recvlength, recvtype);
|
||||||
} else if (urb->status)
|
} else if (urb->status) {
|
||||||
|
kfree_skb(skb);
|
||||||
goto rx_exit;
|
goto rx_exit;
|
||||||
|
}
|
||||||
|
|
||||||
switch (recvtype) {
|
switch (recvtype) {
|
||||||
case CMD_TYPE_DATA:
|
case CMD_TYPE_DATA:
|
||||||
|
Reference in New Issue
Block a user