diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-10-07 20:42:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-08 15:06:04 -0400 |
commit | 9c371f997353385dfa2f7a8004ce13397e071a25 (patch) | |
tree | c2f28b4a17d0f1291801d89ff0435f51abcd4076 /drivers/net | |
parent | 8cc1d52390f53c6dd46ae71e29ea000634a17e3a (diff) |
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 9fd6d9a9942e..9f31cfa56cc0 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) | |||
1804 | { | 1804 | { |
1805 | int ret; | 1805 | int ret; |
1806 | struct ath5k_hw *ah = hw->priv; | 1806 | struct ath5k_hw *ah = hw->priv; |
1807 | struct ath5k_vif *avf = (void *)vif->drv_priv; | 1807 | struct ath5k_vif *avf; |
1808 | struct sk_buff *skb; | 1808 | struct sk_buff *skb; |
1809 | 1809 | ||
1810 | if (WARN_ON(!vif)) { | 1810 | if (WARN_ON(!vif)) { |
@@ -1819,6 +1819,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
1819 | goto out; | 1819 | goto out; |
1820 | } | 1820 | } |
1821 | 1821 | ||
1822 | avf = (void *)vif->drv_priv; | ||
1822 | ath5k_txbuf_free_skb(ah, avf->bbuf); | 1823 | ath5k_txbuf_free_skb(ah, avf->bbuf); |
1823 | avf->bbuf->skb = skb; | 1824 | avf->bbuf->skb = skb; |
1824 | ret = ath5k_beacon_setup(ah, avf->bbuf); | 1825 | ret = ath5k_beacon_setup(ah, avf->bbuf); |