ath10k: fix potential issue of peer stats allocation
authorZhi Chen <zhichen@codeaurora.org>
Wed, 6 Nov 2019 18:04:42 +0000 (20:04 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 8 Nov 2019 08:44:17 +0000 (10:44 +0200)
STA number was not restored if OOM happened.

Tested: QCA9984 with firmware ver 10.4-3.9.0.1-00018
Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/mac.c

index e8bdb2b..5e3450c 100644 (file)
@@ -6604,6 +6604,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
                        arsta->tx_stats = kzalloc(sizeof(*arsta->tx_stats),
                                                  GFP_KERNEL);
                        if (!arsta->tx_stats) {
+                               ath10k_mac_dec_num_stations(arvif, sta);
                                ret = -ENOMEM;
                                goto exit;
                        }