aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel
diff options
context:
space:
mode:
authorJie Yang <yang.jie@intel.com>2015-04-07 20:14:59 +0800
committerMark Brown <broonie@kernel.org>2015-04-08 11:17:51 +0100
commit8e64aedf80ae14b852abc0d7ca262530b69e9a18 (patch)
treec07376cf906120cdfefd7f766e3af21d560aa2a6 /sound/soc/intel
parentASoC: Intel: read_shim_data() can be static (diff)
downloadlinux-dev-8e64aedf80ae14b852abc0d7ca262530b69e9a18.tar.xz
linux-dev-8e64aedf80ae14b852abc0d7ca262530b69e9a18.zip
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: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel')
-rw-r--r--sound/soc/intel/haswell/sst-haswell-pcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/intel/haswell/sst-haswell-pcm.c b/sound/soc/intel/haswell/sst-haswell-pcm.c
index 157b3a6c509e..23ae0400d6db 100644
--- a/sound/soc/intel/haswell/sst-haswell-pcm.c
+++ b/sound/soc/intel/haswell/sst-haswell-pcm.c
@@ -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)