Search Linux Wireless

[PATCH 05/18] brcmfmac: do not reconfigure refill rx on 0-length packet.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hante Meuleman <meuleman@xxxxxxxxxxxx>

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@xxxxxxxxxxxx>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@xxxxxxxxxxxx>
Signed-off-by: Hante Meuleman <meuleman@xxxxxxxxxxxx>
Signed-off-by: Arend van Spriel <arend@xxxxxxxxxxxx>
---
 drivers/net/wireless/brcm80211/brcmfmac/usb.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index 914c56f..22eae57 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -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);
-- 
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux