ASoC: rockchip-i2s: fix infinite loop in rockchip_snd_rxctrl
authorJianqun <jay.xu@rock-chips.com>
Wed, 29 Oct 2014 09:45:51 +0000 (17:45 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 29 Oct 2014 10:17:25 +0000 (10:17 +0000)
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: Jianqun <jay.xu@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
sound/soc/rockchip/rockchip_i2s.c

index f373e37f83050a246c2d35fbed008db7cdd0b5a5..c74ba37f862c121b1114edd84bded49ec7d72907 100644 (file)
@@ -154,8 +154,10 @@ static void rockchip_snd_rxctrl(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;
+                               }
                        }
                }
        }