Skip to content

Commit

Permalink
wil6210: fix break that is never reached because of zero'ing of a ret…
Browse files Browse the repository at this point in the history
…ry counter

There is a check on the retry counter invalid_buf_id_retry that is always
false because invalid_buf_id_retry is initialized to zero on each iteration
of a while-loop.  Fix this by initializing the retry counter before the
while-loop starts.

Addresses-Coverity: ("Logically dead code")
Fixes: b4a967b ("wil6210: reset buff id in status message after completion")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Colin Ian King authored and Kalle Valo committed Nov 25, 2019
1 parent ea0c3e2 commit 5b1413f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/wireless/ath/wil6210/txrx_edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ static struct sk_buff *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
u8 data_offset;
struct wil_rx_status_extended *s;
u16 sring_idx = sring - wil->srings;
int invalid_buff_id_retry;

BUILD_BUG_ON(sizeof(struct wil_rx_status_extended) > sizeof(skb->cb));

Expand All @@ -882,9 +883,9 @@ static struct sk_buff *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
/* Extract the buffer ID from the status message */
buff_id = le16_to_cpu(wil_rx_status_get_buff_id(msg));

invalid_buff_id_retry = 0;
while (!buff_id) {
struct wil_rx_status_extended *s;
int invalid_buff_id_retry = 0;

wil_dbg_txrx(wil,
"buff_id is not updated yet by HW, (swhead 0x%x)\n",
Expand Down

0 comments on commit 5b1413f

Please sign in to comment.