Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5db879ae authored by Raja Mani's avatar Raja Mani Committed by Kalle Valo
Browse files

ath10k: free collected fw stats memory if .pull_fw_stats fails



If .pull_fw_stats() fails for some reason while processing
fw stats event, collected pdev/vdev/peer stats just before
the failure should be freed. This is unlikely to happen,
just code review catch.

Signed-off-by: default avatarRaja Mani <rmani@qti.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent f1ee2682
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -323,7 +323,7 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb)
	ret = ath10k_wmi_pull_fw_stats(ar, skb, &stats);
	ret = ath10k_wmi_pull_fw_stats(ar, skb, &stats);
	if (ret) {
	if (ret) {
		ath10k_warn(ar, "failed to pull fw stats: %d\n", ret);
		ath10k_warn(ar, "failed to pull fw stats: %d\n", ret);
		goto unlock;
		goto free;
	}
	}


	/* Stat data may exceed htc-wmi buffer limit. In such case firmware
	/* Stat data may exceed htc-wmi buffer limit. In such case firmware
@@ -386,7 +386,6 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb)
	ath10k_debug_fw_stats_vdevs_free(&stats.vdevs);
	ath10k_debug_fw_stats_vdevs_free(&stats.vdevs);
	ath10k_debug_fw_stats_peers_free(&stats.peers);
	ath10k_debug_fw_stats_peers_free(&stats.peers);


unlock:
	spin_unlock_bh(&ar->data_lock);
	spin_unlock_bh(&ar->data_lock);
}
}