Skip to content

Commit

Permalink
ASoC: rt5663: add in missing loop counter to avoid infinite loop
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Colin Ian King authored and Mark Brown committed Jul 17, 2017
1 parent 1325734 commit 09b8852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt5663.c
Original file line number Diff line number Diff line change
Expand Up @@ -3044,7 +3044,7 @@ static void rt5663_calibrate(struct rt5663_priv *rt5663)
else
break;

if (count > 200)
if (++count > 200)
break;
}

Expand Down

0 comments on commit 09b8852

Please sign in to comment.