summaryrefslogtreecommitdiffstats
path: root/kernel/sound/hda
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sound/hda')
-rw-r--r--kernel/sound/hda/array.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sound/hda/array.c b/kernel/sound/hda/array.c
index 516795baa..5dfa610e4 100644
--- a/kernel/sound/hda/array.c
+++ b/kernel/sound/hda/array.c
@@ -21,13 +21,15 @@ void *snd_array_new(struct snd_array *array)
return NULL;
if (array->used >= array->alloced) {
int num = array->alloced + array->alloc_align;
+ int oldsize = array->alloced * array->elem_size;
int size = (num + 1) * array->elem_size;
void *nlist;
if (snd_BUG_ON(num >= 4096))
return NULL;
- nlist = krealloc(array->list, size, GFP_KERNEL | __GFP_ZERO);
+ nlist = krealloc(array->list, size, GFP_KERNEL);
if (!nlist)
return NULL;
+ memset(nlist + oldsize, 0, size - oldsize);
array->list = nlist;
array->alloced = num;
}