brcmfmac: do not reconfigure refill rx on 0-length packet.
authorHante Meuleman <meuleman@broadcom.com>
Wed, 2 Jan 2013 14:22:38 +0000 (15:22 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 7 Jan 2013 20:16:55 +0000 (15:16 -0500)
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>
drivers/net/wireless/brcm80211/brcmfmac/usb.c

index 914c56fe6c5f72ec260e27779ebac182b3d2dd0a..22eae57d9546645489814c0f302eb5aaca583539 100644 (file)
@@ -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);