ath9k_htc: Fix memory leak
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Wed, 9 Jan 2013 10:37:48 +0000 (16:07 +0530)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 6 Feb 2013 04:33:42 +0000 (04:33 +0000)
commit 0981c3b24ef664f5611008a6e6d0622fac6d892b upstream.

SKBs that are allocated in the HTC layer do not have callbacks
registered and hence ended up not being freed, Fix this by freeing
them properly in the TX completion routine.

Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/wireless/ath/ath9k/htc_hst.c

index 1b90ed8..4f7843a 100644 (file)
@@ -342,6 +342,8 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle,
                        endpoint->ep_callbacks.tx(endpoint->ep_callbacks.priv,
                                                  skb, htc_hdr->endpoint_id,
                                                  txok);
+               } else {
+                       kfree_skb(skb);
                }
        }