Skip to content

Commit

Permalink
ASoC: rockchip-i2s: fix infinite loop in rockchip_snd_txctrl
Browse files Browse the repository at this point in the history
We can get into an infinite loop if the I2S_CLR register fails to
clear due to a missing break statement, so add that.

Signed-off-by: Sonny Rao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Sonny Rao authored and broonie committed Oct 8, 2014
1 parent a5448c8 commit 528a82b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/soc/rockchip/rockchip_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
while (val) {
regmap_read(i2s->regmap, I2S_CLR, &val);
retry--;
if (!retry)
if (!retry) {
dev_warn(i2s->dev, "fail to clear\n");
break;
}
}
}
}
Expand Down

0 comments on commit 528a82b

Please sign in to comment.