From: Felix Fietkau Date: Wed, 9 Jan 2013 15:16:53 +0000 (+0100) Subject: ath9k: fix double-free bug on beacon generate failure X-Git-Tag: v3.8-rc7~2^2~11^2^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1adb2e2b5f85023d17eb4f95386a57029df27c88;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git ath9k: fix double-free bug on beacon generate failure When the next beacon is sent, the ath_buf from the previous run is reused. If getting a new beacon from mac80211 fails, bf->bf_mpdu is not reset, yet the skb is freed, leading to a double-free on the next beacon tx attempt, resulting in a system crash. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index 531fffd..4eb269d 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c @@ -147,6 +147,7 @@ static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw, skb->len, DMA_TO_DEVICE); dev_kfree_skb_any(skb); bf->bf_buf_addr = 0; + bf->bf_mpdu = NULL; } skb = ieee80211_beacon_get(hw, vif);