diff mbox series

ath10k: fix potential issue of peer stats allocation

Message ID 1572486133-23516-1-git-send-email-zhichen@codeaurora.org (mailing list archive)
State Accepted
Commit 402838a05def2e23736cec834752f3edcc38dda7
Delegated to: Kalle Valo
Headers show
Series ath10k: fix potential issue of peer stats allocation | expand

Commit Message

Zhi Chen Oct. 31, 2019, 1:42 a.m. UTC
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>
---
 drivers/net/wireless/ath/ath10k/mac.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Kalle Valo Nov. 8, 2019, 8:44 a.m. UTC | #1
Zhi Chen <zhichen@codeaurora.org> wrote:

> 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>

Patch applied to ath-next branch of ath.git, thanks.

402838a05def ath10k: fix potential issue of peer stats allocation
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index b73c23d..61efc00 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6419,6 +6419,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;
 			}