2014-10-08 07:59:16

by Sonny Rao

[permalink] [raw]
Subject: [PATCH] ASoC: rockchip-i2s: fix infinite loop in rockchip_snd_txctrl

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]>
---
sound/soc/rockchip/rockchip_i2s.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 033487c..f373e37 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -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;
+ }
}
}
}
--
1.8.3.2


2014-10-08 11:30:21

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] ASoC: rockchip-i2s: fix infinite loop in rockchip_snd_txctrl

On Wed, Oct 08, 2014 at 12:58:51AM -0700, Sonny Rao wrote:
> We can get into an infinite loop if the I2S_CLR register fails to
> clear due to a missing break statement, so add that.

Applied, thanks.


Attachments:
(No filename) (200.00 B)
signature.asc (473.00 B)
Digital signature
Download all attachments