Message ID | 1561094024-32433-1-git-send-email-vnaralas@codeaurora.org (mailing list archive) |
---|---|
State | Accepted |
Commit | a3ba6e2f28a59a04994e31b14cb3614418a10ef2 |
Delegated to: | Kalle Valo |
Headers | show |
Series | ath11k: fix possible mem leak in extd tx stats | expand |
Venkateswara Naralasetty <vnaralas@codeaurora.org> wrote: > This patch fix the memory leak in extd tx stats. > > Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org> > Signed-off-by: Kalle Valo <kvalo@codeaurora.org> 2 patches applied to ath11k-bringup branch of ath.git, thanks. a3ba6e2f28a5 ath11k: fix possible mem leak in extd tx stats b9e30f01194c ath11k: fix line over 90 characters warnings
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index c1e9c34..586c725 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -2597,8 +2597,10 @@ static int ath11k_sta_state(struct ieee80211_hw *hw, if (ath11k_debug_is_extd_tx_stats_enabled(ar)) { arsta->tx_stats = kzalloc(sizeof(*arsta->tx_stats), GFP_KERNEL); - if (!arsta->tx_stats) + if (!arsta->tx_stats) { + ret = -ENOMEM; goto exit; + } } if (ieee80211_vif_is_mesh(vif)) { @@ -2634,8 +2636,8 @@ static int ath11k_sta_state(struct ieee80211_hw *hw, ath11k_mac_dec_num_stations(arvif, sta); - if (ath11k_debug_is_extd_tx_stats_enabled(ar)) - kfree(arsta->tx_stats); + kfree(arsta->tx_stats); + arsta->tx_stats = NULL; kfree(arsta->rx_stats); arsta->rx_stats = NULL;
This patch fix the memory leak in extd tx stats. Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org> --- drivers/net/wireless/ath/ath11k/mac.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)