Skip to content
Snippets Groups Projects
Commit 3f94bfe6 authored by Wright Feng's avatar Wright Feng Committed by Fugang Duan
Browse files

MLK-21161-02 brcmfmac: validate ifp pointer in brcmf_txfinalize


We got ifp null pointer kernel panic in brcmf_txfinalize after removing
Wi-Fi USB dongle when data was transmitting, The root cause is that
interface was removed before calling brcmf_txfinalize in
brcmf_fws_dequeue_worker and finally caused kernel panic.

Signed-off-by: default avatarWright Feng <wright.feng@cypress.com>
Signed-off-by: default avatarFugang Duan <fugang.duan@nxp.com>
parent f7112c02
No related branches found
No related tags found
No related merge requests found
...@@ -370,6 +370,11 @@ void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success) ...@@ -370,6 +370,11 @@ void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success)
struct ethhdr *eh; struct ethhdr *eh;
u16 type; u16 type;
if (!ifp) {
brcmu_pkt_buf_free_skb(txp);
return;
}
eh = (struct ethhdr *)(txp->data); eh = (struct ethhdr *)(txp->data);
type = ntohs(eh->h_proto); type = ntohs(eh->h_proto);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment