ath10k: plug possible memory leak in WMI
authorMichal Kazior <michal.kazior@tieto.com>
Tue, 13 Aug 2013 05:59:38 +0000 (07:59 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 14 Aug 2013 15:01:28 +0000 (18:01 +0300)
There was a possible memory leak when WMI command
queue reached it's limit. Command buffers were not
freed.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/wmi.c

index 55f90c761868ddd9fa228510efb27465d360c00b..775fedfd68329aab81d53acd12b5208f4c0f6a4c 100644 (file)
@@ -110,6 +110,7 @@ static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb,
        if (atomic_add_return(1, &ar->wmi.pending_tx_count) >
            WMI_MAX_PENDING_TX_COUNT) {
                /* avoid using up memory when FW hangs */
+               dev_kfree_skb(skb);
                atomic_dec(&ar->wmi.pending_tx_count);
                return -EBUSY;
        }