ath10k: free collected fw stats memory if .pull_fw_stats fails
authorRaja Mani <rmani@qti.qualcomm.com>
Thu, 9 Jul 2015 08:49:43 +0000 (14:19 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 19 Aug 2015 10:09:18 +0000 (13:09 +0300)
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: Raja Mani <rmani@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/debug.c

index f7aa1c73b4814968420dc50209b302a8a676c383..bf033f46f8aaae1280baf478d66a5890720c962d 100644 (file)
@@ -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);
        if (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
@@ -386,7 +386,6 @@ free:
        ath10k_debug_fw_stats_vdevs_free(&stats.vdevs);
        ath10k_debug_fw_stats_peers_free(&stats.peers);
 
-unlock:
        spin_unlock_bh(&ar->data_lock);
 }