summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorJames Hughes <james.hughes@raspberrypi.org>2017-04-24 12:40:50 +0100
committerKalle Valo <kvalo@codeaurora.org>2017-04-26 12:04:32 +0300
commit455a1eb4654c24560eb9dfc634f29cba3d87601e (patch)
treec9128c8ff4e111c4b6bc230addbb16e31fbf4f09 /drivers/net
parent9dc7efd3978aa67ae598129d2a3f240b390ce508 (diff)
brcmfmac: Ensure pointer correctly set if skb data location changes
The incoming skb header may be resized if header space is insufficient, which might change the data adddress in the skb. Ensure that a cached pointer to that data is correctly set by moving assignment to after any possible changes. Signed-off-by: James Hughes <james.hughes@raspberrypi.org> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index 24118ce72b4f..753db686649f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -197,7 +197,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
int ret;
struct brcmf_if *ifp = netdev_priv(ndev);
struct brcmf_pub *drvr = ifp->drvr;
- struct ethhdr *eh = (struct ethhdr *)(skb->data);
+ struct ethhdr *eh;
brcmf_dbg(DATA, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
@@ -235,6 +235,8 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
goto done;
}
+ eh = (struct ethhdr *)(skb->data);
+
if (eh->h_proto == htons(ETH_P_PAE))
atomic_inc(&ifp->pend_8021x_cnt);