[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170710152045.28898-1-colin.king@canonical.com>
Date: Mon, 10 Jul 2017 16:20:45 +0100
From: Colin King <colin.king@...onical.com>
To: Bard Liao <bardliao@...ltek.com>,
Oder Chiou <oder_chiou@...ltek.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][-next] ASoC: rt5663: add in missing loop counter to avoid infinite loop
From: Colin Ian King <colin.king@...onical.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@...onical.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
Powered by blists - more mailing lists