summaryrefslogtreecommitdiffstats
path: root/sound/hda/array.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-08-05 09:45:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-05 09:45:14 -0400
commitd4c06c708123c652025d04fe77b7e39448077395 (patch)
treeb6f8a9fdc7e1a9462744e6ba8720a469d060fb0c /sound/hda/array.c
parent2cfd716d2777489db54a237f466a1c42700879c6 (diff)
parent59ec4b57bcaede46546d54d037a21004b9aa5cef (diff)
downloadlinux-d4c06c708123c652025d04fe77b7e39448077395.tar.gz
linux-d4c06c708123c652025d04fe77b7e39448077395.tar.bz2
linux-d4c06c708123c652025d04fe77b7e39448077395.zip
Merge tag 'sound-fix-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Nothing existing here: as usual a few HD-audio fixes (device fixups, a new AMD PCI ID, and a fix for krealloc() usage), in addition to a fix in Kconfig for legacy arm drivers" * tag 'sound-fix-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Fix headset mic detection problem for two dell machines ALSA: hda: Fix krealloc() with __GFP_ZERO usage ALSA: hda: add AMD Bonaire AZ PCI ID with proper driver caps ALSA: arm: Fix empty menuconfig SND_ARM ALSA: hda - On-board speaker fixup on ACER Veriton ALSA: hda/realtek - Can't adjust speaker's volume on a Dell AIO
Diffstat (limited to 'sound/hda/array.c')
-rw-r--r--sound/hda/array.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/hda/array.c b/sound/hda/array.c
index 516795baa7db..5dfa610e4471 100644
--- a/sound/hda/array.c
+++ b/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;
}