Skip to content

Commit

Permalink
ath6kl: Fix htc_packet leak in ath6kl_htc_rx_fetch()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  • Loading branch information
Vasanthakumar Thiagarajan authored and Kalle Valo committed Nov 11, 2011
1 parent 4159cc9 commit b8d5d5f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/wireless/ath/ath6kl/htc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
}

Expand Down

0 comments on commit b8d5d5f

Please sign in to comment.