mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][-next] ASoC: rt5663: add in missing loop counter to avoid infinite loop
@ 2017-07-10 15:20 Colin King
  2017-07-10 18:42 ` Applied "ASoC: rt5663: add in missing loop counter to avoid infinite loop" to the asoc tree Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-07-10 15:20 UTC (permalink / raw)
  To: Bard Liao, Oder Chiou, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel
  Cc: kernel-janitors, linux-kernel

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

The loop counter 'count' is missing an increment, so we could end up
with an infinite loop.  Add in a pre-increment to count to fix this.

Detected by CoverityScan, CID#1450120 ("Logically Dead Code")

Fixes: 1a425dbf1a10 ("ASoC: rt5663: Update the calibration funciton")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 sound/soc/codecs/rt5663.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c
index 82edbcf39caa..5b3c50c641d8 100644
--- a/sound/soc/codecs/rt5663.c
+++ b/sound/soc/codecs/rt5663.c
@@ -3044,7 +3044,7 @@ static void rt5663_calibrate(struct rt5663_priv *rt5663)
 		else
 			break;
 
-		if (count > 200)
+		if (++count > 200)
 			break;
 	}
 
-- 
2.11.0

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

end of thread, other threads:[~2017-07-10 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-10 15:20 [PATCH][-next] ASoC: rt5663: add in missing loop counter to avoid infinite loop Colin King
2017-07-10 18:42 ` Applied "ASoC: rt5663: add in missing loop counter to avoid infinite loop" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®