summaryrefslogtreecommitdiffstats
path: root/sound/pci/au88x0
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-05-12 12:04:16 -0400
committerTakashi Iwai <tiwai@suse.de>2016-05-12 12:04:16 -0400
commit639db596165746ca87bbcb56559b094fd9042890 (patch)
tree587a8ad80211b1c8a3c99e836295c88a34f45ace /sound/pci/au88x0
parentff38e0c70adce96de0be0bf470cbb9e283ba6965 (diff)
ALSA: au88x0: Fix zero clear of stream->resources
There are a few calls of memset() to stream->resources, but they all are called in a wrong size, sizeof(unsigned char) * VORTEX_RESOURCE_LAST, while this field is a u32 array. This may leave the memories not zero-cleared. Fix it by replacing them with a simpler sizeof(stream->resources) instead. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/au88x0')
-rw-r--r--sound/pci/au88x0/au88x0_core.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index 4667c3232b7f..4a054d720112 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -2151,8 +2151,7 @@ vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir,
2151 stream->resources, en, 2151 stream->resources, en,
2152 VORTEX_RESOURCE_SRC)) < 0) { 2152 VORTEX_RESOURCE_SRC)) < 0) {
2153 memset(stream->resources, 0, 2153 memset(stream->resources, 0,
2154 sizeof(unsigned char) * 2154 sizeof(stream->resources));
2155 VORTEX_RESOURCE_LAST);
2156 return -EBUSY; 2155 return -EBUSY;
2157 } 2156 }
2158 if (stream->type != VORTEX_PCM_A3D) { 2157 if (stream->type != VORTEX_PCM_A3D) {
@@ -2162,7 +2161,7 @@ vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir,
2162 VORTEX_RESOURCE_MIXIN)) < 0) { 2161 VORTEX_RESOURCE_MIXIN)) < 0) {
2163 memset(stream->resources, 2162 memset(stream->resources,
2164 0, 2163 0,
2165 sizeof(unsigned char) * VORTEX_RESOURCE_LAST); 2164 sizeof(stream->resources));
2166 return -EBUSY; 2165 return -EBUSY;
2167 } 2166 }
2168 } 2167 }
@@ -2175,8 +2174,7 @@ vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir,
2175 stream->resources, en, 2174 stream->resources, en,
2176 VORTEX_RESOURCE_A3D)) < 0) { 2175 VORTEX_RESOURCE_A3D)) < 0) {
2177 memset(stream->resources, 0, 2176 memset(stream->resources, 0,
2178 sizeof(unsigned char) * 2177 sizeof(stream->resources));
2179 VORTEX_RESOURCE_LAST);
2180 dev_err(vortex->card->dev, 2178 dev_err(vortex->card->dev,
2181 "out of A3D sources. Sorry\n"); 2179 "out of A3D sources. Sorry\n");
2182 return -EBUSY; 2180 return -EBUSY;
@@ -2290,8 +2288,7 @@ vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir,
2290 VORTEX_RESOURCE_MIXOUT)) 2288 VORTEX_RESOURCE_MIXOUT))
2291 < 0) { 2289 < 0) {
2292 memset(stream->resources, 0, 2290 memset(stream->resources, 0,
2293 sizeof(unsigned char) * 2291 sizeof(stream->resources));
2294 VORTEX_RESOURCE_LAST);
2295 return -EBUSY; 2292 return -EBUSY;
2296 } 2293 }
2297 if ((src[i] = 2294 if ((src[i] =
@@ -2299,8 +2296,7 @@ vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir,
2299 stream->resources, en, 2296 stream->resources, en,
2300 VORTEX_RESOURCE_SRC)) < 0) { 2297 VORTEX_RESOURCE_SRC)) < 0) {
2301 memset(stream->resources, 0, 2298 memset(stream->resources, 0,
2302 sizeof(unsigned char) * 2299 sizeof(stream->resources));
2303 VORTEX_RESOURCE_LAST);
2304 return -EBUSY; 2300 return -EBUSY;
2305 } 2301 }
2306 } 2302 }