[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1619794016-27348-1-git-send-email-wangyunjian@huawei.com>
Date: Fri, 30 Apr 2021 22:46:56 +0800
From: wangyunjian <wangyunjian@...wei.com>
To: <kuba@...nel.org>, <davem@...emloft.net>
CC: <amitkarwar@...il.com>, <siva8118@...il.com>,
<linux-wireless@...r.kernel.org>, <netdev@...r.kernel.org>,
<dingxiaoxiong@...wei.com>, Yunjian Wang <wangyunjian@...wei.com>
Subject: [PATCH net] rsi: Add a NULL check in rsi_core_xmit
From: Yunjian Wang <wangyunjian@...wei.com>
The skb may be NULL in rsi_core_xmit(). Add a check to avoid
dereferencing null pointer.
Addresses-Coverity: ("Dereference after null check")
Fixes: dad0d04fa7ba ("rsi: Add RS9113 wireless driver")
Signed-off-by: Yunjian Wang <wangyunjian@...wei.com>
---
drivers/net/wireless/rsi/rsi_91x_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rsi/rsi_91x_core.c b/drivers/net/wireless/rsi/rsi_91x_core.c
index a48e616e0fb9..436e7b30d159 100644
--- a/drivers/net/wireless/rsi/rsi_91x_core.c
+++ b/drivers/net/wireless/rsi/rsi_91x_core.c
@@ -492,5 +492,6 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)
xmit_fail:
rsi_dbg(ERR_ZONE, "%s: Failed to queue packet\n", __func__);
/* Dropping pkt here */
- ieee80211_free_txskb(common->priv->hw, skb);
+ if (skb)
+ ieee80211_free_txskb(common->priv->hw, skb);
}
--
2.19.1
Powered by blists - more mailing lists