提交 8e64aedf 编写于 作者: J Jie Yang 提交者: Mark Brown

ASoC: Intel: Fix a buffer overflow issue

0day robot reported a buffer overflow issue:

...
sound/soc/intel/haswell/sst-haswell-pcm.c:1107 hsw_pcm_probe() error: buffer\
overflow 'hsw_dais' 4 <= 4
sound/soc/intel/haswell/sst-haswell-pcm.c:1109 hsw_pcm_probe() error: buffer\
overflow 'hsw_dais' 4 <= 4
...

Fix it by initializing the index(i) to correct value.
Signed-off-by: NJie Yang <yang.jie@intel.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 f34c4bc7
......@@ -1103,7 +1103,7 @@ static int hsw_pcm_probe(struct snd_soc_platform *platform)
return 0;
err:
for (;i >= 0; i--) {
for (--i; i >= 0; i--) {
if (hsw_dais[i].playback.channels_min)
snd_dma_free_pages(&priv_data->dmab[i][0]);
if (hsw_dais[i].capture.channels_min)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册