linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wil6210: fix break that is never reached because of zero'ing of a retry counter
@ 2019-11-15 12:09 Colin King
  2019-11-17  8:06 ` merez
  2019-11-25 12:14 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-11-15 12:09 UTC (permalink / raw)
  To: Maya Erez, Kalle Valo, David S . Miller, linux-wireless, wil6210, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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: b4a967b7d0f5 ("wil6210: reset buff id in status message after completion")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---

Note: not tested, so I'm not sure if the loop retry threshold is high enough

---
 drivers/net/wireless/ath/wil6210/txrx_edma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.c b/drivers/net/wireless/ath/wil6210/txrx_edma.c
index 778b63be6a9a..02548d40253c 100644
--- a/drivers/net/wireless/ath/wil6210/txrx_edma.c
+++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c
@@ -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));
 
@@ -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",
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] wil6210: fix break that is never reached because of zero'ing of a retry counter
  2019-11-15 12:09 [PATCH] wil6210: fix break that is never reached because of zero'ing of a retry counter Colin King
@ 2019-11-17  8:06 ` merez
  2019-11-25 12:14 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: merez @ 2019-11-17  8:06 UTC (permalink / raw)
  To: Colin King
  Cc: Kalle Valo, David S . Miller, linux-wireless, wil6210, netdev,
	kernel-janitors, linux-kernel

On 2019-11-15 14:09, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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: b4a967b7d0f5 ("wil6210: reset buff id in status message after
> completion")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> 
> Note: not tested, so I'm not sure if the loop retry threshold is high 
> enough
> 
> ---

Reviewed-by: Maya Erez <merez@codeaurora.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] wil6210: fix break that is never reached because of zero'ing of a retry counter
  2019-11-15 12:09 [PATCH] wil6210: fix break that is never reached because of zero'ing of a retry counter Colin King
  2019-11-17  8:06 ` merez
@ 2019-11-25 12:14 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2019-11-25 12:14 UTC (permalink / raw)
  To: Colin King
  Cc: Maya Erez, David S . Miller, linux-wireless, wil6210, netdev,
	kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> wrote:

> 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: b4a967b7d0f5 ("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>

Patch applied to ath-next branch of ath.git, thanks.

5b1413f00b5b wil6210: fix break that is never reached because of zero'ing of a retry counter

-- 
https://patchwork.kernel.org/patch/11246193/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-25 12:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15 12:09 [PATCH] wil6210: fix break that is never reached because of zero'ing of a retry counter Colin King
2019-11-17  8:06 ` merez
2019-11-25 12:14 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).