Skip to content

Commit

Permalink
brcmfmac: do not reconfigure refill rx on 0-length packet.
Browse files Browse the repository at this point in the history
When USB device gets removed rx complete comes with 0-length
packets. Do not refill those packets. In some rare cases it can
cause infinite loop.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Hante Meuleman authored and John W. Linville committed Jan 7, 2013
1 parent 637ccc2 commit 0429a6f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/wireless/brcm80211/brcmfmac/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,11 @@ static void brcmf_usb_rx_complete(struct urb *urb)
devinfo->bus_pub.bus->dstats.rx_errors++;
} else
brcmf_rx_packet(devinfo->dev, ifidx, skb);
brcmf_usb_rx_refill(devinfo, req);
/* zero lenght packets indicate usb "failure". Do not refill */
if (urb->actual_length)
brcmf_usb_rx_refill(devinfo, req);
else
brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req, NULL);
} else {
brcmu_pkt_buf_free_skb(skb);
brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req, NULL);
Expand Down

0 comments on commit 0429a6f

Please sign in to comment.