Commit f984d94c authored by Sujith's avatar Sujith Committed by John W. Linville

ath9k_htc: Fix HTC layer memleak

Messages that are generated by the HTC layer
don't have any TX callback endpoints assigned to them.
Consequently, the allocated SKBs are never freed.

Fix this issue by handling this case in the HTC layer
itself.
Signed-off-by: default avatarSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6f0f2669
...@@ -326,11 +326,13 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle, ...@@ -326,11 +326,13 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle,
if (htc_handle->htc_flags & HTC_OP_CONFIG_PIPE_CREDITS) { if (htc_handle->htc_flags & HTC_OP_CONFIG_PIPE_CREDITS) {
complete(&htc_handle->cmd_wait); complete(&htc_handle->cmd_wait);
htc_handle->htc_flags &= ~HTC_OP_CONFIG_PIPE_CREDITS; htc_handle->htc_flags &= ~HTC_OP_CONFIG_PIPE_CREDITS;
goto ret;
} }
if (htc_handle->htc_flags & HTC_OP_START_WAIT) { if (htc_handle->htc_flags & HTC_OP_START_WAIT) {
complete(&htc_handle->cmd_wait); complete(&htc_handle->cmd_wait);
htc_handle->htc_flags &= ~HTC_OP_START_WAIT; htc_handle->htc_flags &= ~HTC_OP_START_WAIT;
goto ret;
} }
if (skb) { if (skb) {
...@@ -343,6 +345,11 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle, ...@@ -343,6 +345,11 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle,
htc_hdr->endpoint_id, txok); htc_hdr->endpoint_id, txok);
} }
} }
return;
ret:
/* HTC-generated packets are freed here. */
dev_kfree_skb_any(skb);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment