summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm0010.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-30 08:35:03 +0100
committerMark Brown <broonie@linaro.org>2013-10-30 09:38:21 -0700
commitc36c89096cb9f95fbdb0a6f3d80d4b9a50537ed3 (patch)
tree2fda19299091c4375fe4040ad2eaf871bd70b77b /sound/soc/codecs/wm0010.c
parent959f58544b7f20c92d5eb43d1232c96c15c01bfb (diff)
downloadlinux-c36c89096cb9f95fbdb0a6f3d80d4b9a50537ed3.tar.gz
linux-c36c89096cb9f95fbdb0a6f3d80d4b9a50537ed3.tar.bz2
linux-c36c89096cb9f95fbdb0a6f3d80d4b9a50537ed3.zip
ASoC: wm0010: Fix possible out-of-bounds array read
Spotted by coverity CID 744701. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/wm0010.c')
-rw-r--r--sound/soc/codecs/wm0010.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c
index d5ebcb00019b..bf7804a12863 100644
--- a/sound/soc/codecs/wm0010.c
+++ b/sound/soc/codecs/wm0010.c
@@ -793,11 +793,11 @@ static int wm0010_set_sysclk(struct snd_soc_codec *codec, int source,
wm0010->max_spi_freq = 0;
} else {
for (i = 0; i < ARRAY_SIZE(pll_clock_map); i++)
- if (freq >= pll_clock_map[i].max_sysclk)
+ if (freq >= pll_clock_map[i].max_sysclk) {
+ wm0010->max_spi_freq = pll_clock_map[i].max_pll_spi_speed;
+ wm0010->pll_clkctrl1 = pll_clock_map[i].pll_clkctrl1;
break;
-
- wm0010->max_spi_freq = pll_clock_map[i].max_pll_spi_speed;
- wm0010->pll_clkctrl1 = pll_clock_map[i].pll_clkctrl1;
+ }
}
return 0;