]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ASoC: rt5663: add in missing loop counter to avoid infinite loop
authorColin Ian King <colin.king@canonical.com>
Mon, 10 Jul 2017 15:20:45 +0000 (16:20 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Jul 2017 11:05:54 +0000 (12:05 +0100)
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5663.c

index 82edbcf39caab535aed6c2dff22a59fdb78b7790..5b3c50c641d8dd9f28405b574f7dd6312cc932e9 100644 (file)
@@ -3044,7 +3044,7 @@ static void rt5663_calibrate(struct rt5663_priv *rt5663)
                else
                        break;
 
-               if (count > 200)
+               if (++count > 200)
                        break;
        }