brcmfmac: fix regression in brcmf_sdio_txpkt_hdalign()
authorArend Van Spriel <arend.vanspriel@broadcom.com>
Wed, 12 Jul 2017 09:32:48 +0000 (10:32 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 21 Jul 2017 07:40:48 +0000 (10:40 +0300)
Recent change in brcmf_sdio_txpkt_hdalign() changed the
behavior and now always returns 0. This resulted in a
regression which basically renders the device useless.

Fixes: 270a6c1f65fe ("brcmfmac: rework headroom check in .start_xmit()")
Reported-by: S. Gilles <sgilles@math.umd.edu>
Tested-by: S. Gilles <sgilles@math.umd.edu>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

index fbcbb43259366ccd87c37119a5024dbb825099ed..c3ecec673eb74868537ea6f1df5520161423a715 100644 (file)
@@ -2053,12 +2053,13 @@ static int brcmf_sdio_txpkt_hdalign(struct brcmf_sdio *bus, struct sk_buff *pkt)
                                atomic_inc(&stats->pktcow_failed);
                                return -ENOMEM;
                        }
+                       head_pad = 0;
                }
                skb_push(pkt, head_pad);
                dat_buf = (u8 *)(pkt->data);
        }
        memset(dat_buf, 0, head_pad + bus->tx_hdrlen);
-       return 0;
+       return head_pad;
 }
 
 /**