Skip to content

Commit 455a1eb

Browse files
James HughesKalle Valo
authored andcommitted
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>
1 parent 9dc7efd commit 455a1eb

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

1 file changed

+3
-1
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
197197
int ret;
198198
struct brcmf_if *ifp = netdev_priv(ndev);
199199
struct brcmf_pub *drvr = ifp->drvr;
200-
struct ethhdr *eh = (struct ethhdr *)(skb->data);
200+
struct ethhdr *eh;
201201

202202
brcmf_dbg(DATA, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
203203

@@ -235,6 +235,8 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
235235
goto done;
236236
}
237237

238+
eh = (struct ethhdr *)(skb->data);
239+
238240
if (eh->h_proto == htons(ETH_P_PAE))
239241
atomic_inc(&ifp->pend_8021x_cnt);
240242

0 commit comments

Comments
 (0)