319-v4.12-0051-brcmfmac-Ensure-pointer-correctly-set-if-skb-data-lo.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 455a1eb4654c24560eb9dfc634f29cba3d87601e Mon Sep 17 00:00:00 2001
  2. From: James Hughes <james.hughes@raspberrypi.org>
  3. Date: Mon, 24 Apr 2017 12:40:50 +0100
  4. Subject: [PATCH] brcmfmac: Ensure pointer correctly set if skb data location
  5. changes
  6. The incoming skb header may be resized if header space is
  7. insufficient, which might change the data adddress in the skb.
  8. Ensure that a cached pointer to that data is correctly set by
  9. moving assignment to after any possible changes.
  10. Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
  11. Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  12. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  13. ---
  14. drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 4 +++-
  15. 1 file changed, 3 insertions(+), 1 deletion(-)
  16. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  17. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  18. @@ -197,7 +197,7 @@ static netdev_tx_t brcmf_netdev_start_xm
  19. int ret;
  20. struct brcmf_if *ifp = netdev_priv(ndev);
  21. struct brcmf_pub *drvr = ifp->drvr;
  22. - struct ethhdr *eh = (struct ethhdr *)(skb->data);
  23. + struct ethhdr *eh;
  24. brcmf_dbg(DATA, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
  25. @@ -235,6 +235,8 @@ static netdev_tx_t brcmf_netdev_start_xm
  26. goto done;
  27. }
  28. + eh = (struct ethhdr *)(skb->data);
  29. +
  30. if (eh->h_proto == htons(ETH_P_PAE))
  31. atomic_inc(&ifp->pend_8021x_cnt);