mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 18:13:04 +00:00
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>
This commit is contained in:
parent
959f58544b
commit
c36c89096c
@ -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)
|
||||
break;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user