From 047445c579dc28772aadaac6b7b37289aad72b22 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Wed, 17 Apr 2013 21:25:58 +0200 Subject: [PATCH] brcmfmac: stop dequeue upon sk_buff commit failure In the dequeue worker the function brcmf_commit_skb() is called. However, instead of increment the credit count upon success it should break the for loop upon failure. Otherwise, it will result in an endless loop. Reviewed-by: Hante Meuleman Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Arend van Spriel Signed-off-by: John W. Linville --- drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c index 25eaa1305db2..8ae7da8bf688 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c @@ -1850,10 +1850,9 @@ static void brcmf_fws_dequeue_worker(struct work_struct *worker) fws->fifo_credit[fifo]); for (credit = 0; credit < fws->fifo_credit[fifo]; /* nop */) { skb = brcmf_fws_deq(fws, fifo); - if (!skb) + if (!skb || brcmf_fws_commit_skb(fws, fifo, skb)) break; - if (!brcmf_fws_commit_skb(fws, fifo, skb) && - brcmf_skbcb(skb)->if_flags & + if (brcmf_skbcb(skb)->if_flags & BRCMF_SKB_IF_FLAGS_CREDITCHECK_MASK) credit++; } -- 2.20.1