Commit 9c371f99 authored by Wei Yongjun's avatar Wei Yongjun Committed by John W. Linville

ath5k: fix potential NULL pointer dereference in ath5k_beacon_update()

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8cc1d523
...@@ -1804,7 +1804,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -1804,7 +1804,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{ {
int ret; int ret;
struct ath5k_hw *ah = hw->priv; struct ath5k_hw *ah = hw->priv;
struct ath5k_vif *avf = (void *)vif->drv_priv; struct ath5k_vif *avf;
struct sk_buff *skb; struct sk_buff *skb;
if (WARN_ON(!vif)) { if (WARN_ON(!vif)) {
...@@ -1819,6 +1819,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -1819,6 +1819,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
goto out; goto out;
} }
avf = (void *)vif->drv_priv;
ath5k_txbuf_free_skb(ah, avf->bbuf); ath5k_txbuf_free_skb(ah, avf->bbuf);
avf->bbuf->skb = skb; avf->bbuf->skb = skb;
ret = ath5k_beacon_setup(ah, avf->bbuf); ret = ath5k_beacon_setup(ah, avf->bbuf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment