Skip to content

Commit

Permalink
ath9k_htc: Fix HTC layer memleak
Browse files Browse the repository at this point in the history
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: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Sujith authored and John W. Linville committed Apr 8, 2010
1 parent 6f0f266 commit f984d94
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/wireless/ath/ath9k/htc_hst.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,13 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle,
if (htc_handle->htc_flags & HTC_OP_CONFIG_PIPE_CREDITS) {
complete(&htc_handle->cmd_wait);
htc_handle->htc_flags &= ~HTC_OP_CONFIG_PIPE_CREDITS;
goto ret;
}

if (htc_handle->htc_flags & HTC_OP_START_WAIT) {
complete(&htc_handle->cmd_wait);
htc_handle->htc_flags &= ~HTC_OP_START_WAIT;
goto ret;
}

if (skb) {
Expand All @@ -343,6 +345,11 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle,
htc_hdr->endpoint_id, txok);
}
}

return;
ret:
/* HTC-generated packets are freed here. */
dev_kfree_skb_any(skb);
}

/*
Expand Down

0 comments on commit f984d94

Please sign in to comment.