Add check for the return value of skb_copy in order to avoid NULL pointer dereference. Fixes: 838e4f449297 ("mwifiex: improve uAP RX handling") Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx> --- drivers/net/wireless/marvell/mwifiex/uap_txrx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/uap_txrx.c b/drivers/net/wireless/marvell/mwifiex/uap_txrx.c index e495f7eaea03..9cfa5de57207 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_txrx.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_txrx.c @@ -243,6 +243,8 @@ int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv, if (is_multicast_ether_addr(ra)) { skb_uap = skb_copy(skb, GFP_ATOMIC); + if (!skb_uap) + return -ENOMEM; mwifiex_uap_queue_bridged_pkt(priv, skb_uap); } else { if (mwifiex_get_sta_entry(priv, ra)) { -- 2.25.1