From: Vasanthakumar Thiagarajan Date: Mon, 3 Oct 2011 11:58:25 +0000 (+0530) Subject: ath6kl: Fix htc_packet leak in ath6kl_htc_rx_fetch() X-Git-Tag: next-20111118~41^2~15^2~113 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b8d5d5ff0305f07061f672c91f63479433451af5;p=karo-tx-linux.git ath6kl: Fix htc_packet leak in ath6kl_htc_rx_fetch() 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 Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c index 7bc988438ead..4a03dacd9208 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); } }