Message ID | 20230707095121.10453-1-jiasheng@iscas.ac.cn |
---|---|
State | New |
Headers | show |
Series | mwifiex: Add check for skb_copy | expand |
On Fri, 7 Jul 2023 17:51:21 +0800 Jiasheng Jiang wrote: > 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@iscas.ac.cn> Amitkumar, Ganapathi, Sharvari, Xinming please review.
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)) {
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@iscas.ac.cn> --- drivers/net/wireless/marvell/mwifiex/uap_txrx.c | 2 ++ 1 file changed, 2 insertions(+)