Search Linux Wireless

[PATCH net] rsi: Add a NULL check in rsi_core_xmit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Yunjian Wang <wangyunjian@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux