]> git.hungrycats.org Git - linux/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Dec 2014 23:57:20 +0000 (15:57 -0800)
commit 29f95bd76f6ec1eff88eec6a04191104a11a7f97 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/rockchip/rockchip_i2s.c

index fb9e05c9f47199c7bdcbd8413846899b074615ce..244fb1cd17957cb40e5c020ce3f0007cc0493b87 100644 (file)
@@ -152,8 +152,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;
+                               }
                        }
                }
        }