[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAPgLHd8JOwHeMPu1MfUvse1npL7QMXxgMk4xkjft-JEP_mbv4w@mail.gmail.com>
Date: Mon, 8 Oct 2012 08:42:58 +0800
From: Wei Yongjun <weiyj.lk@...il.com>
To: jirislaby@...il.com, mickflemm@...il.com, mcgrof@....qualcomm.com,
linville@...driver.com
Cc: yongjun_wei@...ndmicro.com.cn, linux-wireless@...r.kernel.org,
ath5k-devel@...ts.ath5k.org, netdev@...r.kernel.org
Subject: [PATCH] ath5k: fix potential NULL pointer dereference in ath5k_beacon_update()
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
The dereference should be moved below the NULL test.
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
drivers/net/wireless/ath/ath5k/base.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 9fd6d9a..9f31cfa 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1804,7 +1804,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{
int ret;
struct ath5k_hw *ah = hw->priv;
- struct ath5k_vif *avf = (void *)vif->drv_priv;
+ struct ath5k_vif *avf;
struct sk_buff *skb;
if (WARN_ON(!vif)) {
@@ -1819,6 +1819,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
goto out;
}
+ avf = (void *)vif->drv_priv;
ath5k_txbuf_free_skb(ah, avf->bbuf);
avf->bbuf->skb = skb;
ret = ath5k_beacon_setup(ah, avf->bbuf);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists