Linux wireless drivers development
 help / color / mirror / Atom feed
From: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
To: <kvalo@qca.qualcomm.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH 2/4] ath6kl: Fix htc_packet leak in ath6kl_htc_rx_fetch()
Date: Mon, 3 Oct 2011 17:26:25 +0530	[thread overview]
Message-ID: <1317642987-16026-2-git-send-email-vthiagar@qca.qualcomm.com> (raw)
In-Reply-To: <1317642987-16026-1-git-send-email-vthiagar@qca.qualcomm.com>

It is found during the code review. As the leak would happen only
in failure case, the imapct is not easily visible.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/htc.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

V2 -- Change in commit log

diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index 7bc9884..4a03dac 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -1715,12 +1715,10 @@ static int ath6kl_htc_rx_fetch(struct htc_target *target,
 			packet = list_first_entry(rx_pktq, struct htc_packet,
 						   list);
 
-			list_del(&packet->list);
-
 			/* fully synchronous */
 			packet->completion = NULL;
 
-			if (!list_empty(rx_pktq))
+			if (!list_is_singular(rx_pktq))
 				/*
 				 * look_aheads in all packet
 				 * except the last one in the
@@ -1735,7 +1733,7 @@ static int ath6kl_htc_rx_fetch(struct htc_target *target,
 			if (status)
 				return status;
 
-			list_add_tail(&packet->list, comp_pktq);
+			list_move_tail(&packet->list, comp_pktq);
 		}
 	}
 
-- 
1.7.0.4


  reply	other threads:[~2011-10-03 11:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03 11:56 [PATCH 1/4] ath6kl: Fix htc_packet leak in ath6kl_htc_rx_process_packets() Vasanthakumar Thiagarajan
2011-10-03 11:56 ` Vasanthakumar Thiagarajan [this message]
2011-10-03 11:56 ` [PATCH V2 3/4] ath6kl: Avoid processing failed rx packets Vasanthakumar Thiagarajan
2011-10-03 11:56 ` [PATCH V2 4/4] ath6kl: Minor cleanup in msg_look_ahead parameter in ath6kl_htc_rxmsg_pending_handler() Vasanthakumar Thiagarajan
  -- strict thread matches above, loose matches on Subject: below --
2011-09-29 15:01 [PATCH 1/4] ath6kl: Fix htc_packet leak in ath6kl_htc_rx_process_packets() Vasanthakumar Thiagarajan
2011-09-29 15:01 ` [PATCH 2/4] ath6kl: Fix htc_packet leak in ath6kl_htc_rx_fetch() Vasanthakumar Thiagarajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317642987-16026-2-git-send-email-vthiagar@qca.qualcomm.com \
    --to=vthiagar@qca.qualcomm.com \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox