aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2011-10-03 07:58:07 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-11-11 05:50:54 -0500
commit4159cc935a7ed119e5f824db06defaa34d992b56 (patch)
tree7e5a7bf27f7d7e717173c9636820ac84bd9ecb3d /drivers
parent861dd058f495973c7ad2a44b8f68f3cc05733eab (diff)
ath6kl: Fix htc_packet leak in ath6kl_htc_rx_process_packets()
Packet is not reclaimed when ath6kl_htc_rx_process_hdr() fails. Fix this by deferring the packet deletion from comp_pktq till ath6kl_htc_rx_process_hdr() returns success. This bug is found in code review, impact is not easily visible as the leak happens only in failure cases. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath6kl/htc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index f88a7c9e4148..7bc988438ead 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -1643,7 +1643,6 @@ static int ath6kl_htc_rx_process_packets(struct htc_target *target,
1643 int status = 0; 1643 int status = 0;
1644 1644
1645 list_for_each_entry_safe(packet, tmp_pkt, comp_pktq, list) { 1645 list_for_each_entry_safe(packet, tmp_pkt, comp_pktq, list) {
1646 list_del(&packet->list);
1647 ep = &target->endpoint[packet->endpoint]; 1646 ep = &target->endpoint[packet->endpoint];
1648 1647
1649 /* process header for each of the recv packet */ 1648 /* process header for each of the recv packet */
@@ -1652,6 +1651,8 @@ static int ath6kl_htc_rx_process_packets(struct htc_target *target,
1652 if (status) 1651 if (status)
1653 return status; 1652 return status;
1654 1653
1654 list_del(&packet->list);
1655
1655 if (list_empty(comp_pktq)) { 1656 if (list_empty(comp_pktq)) {
1656 /* 1657 /*
1657 * Last packet's more packet flag is set 1658 * Last packet's more packet flag is set