From: Colin Ian King Date: Mon, 10 Jul 2017 15:20:45 +0000 (+0100) Subject: ASoC: rt5663: add in missing loop counter to avoid infinite loop X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=09b8852c759917e3ea10062b374692a5313cbfd8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ASoC: rt5663: add in missing loop counter to avoid infinite loop 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 Signed-off-by: Mark Brown --- 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; }