mac80211: add brcmfmac regression ("NULL pointer dereference") fix
[openwrt/staging/wigyori.git] / package / kernel / mac80211 / patches / 860-brcmfmac-add-missing-eth_type_trans-call.patch
1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
2 Subject: [PATCH] brcmfmac: add missing eth_type_trans call
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset=UTF-8
5 Content-Transfer-Encoding: 8bit
6
7 There are 2 protocols supported by brcmfmac and msgbuf one was missing a
8 proper skb setup before passing it to the netif. This was triggering
9 "NULL pointer dereference".
10
11 Fixes: 9c349892ccc9 ("brcmfmac: revise handling events in receive path")
12 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
13 ---
14
15 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
16 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
17 @@ -1157,6 +1157,9 @@ brcmf_msgbuf_process_rx_complete(struct brcmf_msgbuf *msgbuf, void *buf)
18 brcmu_pkt_buf_free_skb(skb);
19 return;
20 }
21 +
22 + skb->protocol = eth_type_trans(skb, ifp->ndev);
23 +
24 brcmf_netif_rx(ifp, skb);
25 }
26