Browse Source

ALSA: hda - Drop explicit memset() by reallocation with __GFP_ZERO

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 12 years ago
parent
commit
5265fd9a9f
1 changed files with 1 additions and 3 deletions
  1. 1 3
      sound/pci/hda/hda_codec.c

+ 1 - 3
sound/pci/hda/hda_codec.c

@@ -5535,14 +5535,12 @@ void *snd_array_new(struct snd_array *array)
 	if (array->used >= array->alloced) {
 		int num = array->alloced + array->alloc_align;
 		int size = (num + 1) * array->elem_size;
-		int oldsize = array->alloced * array->elem_size;
 		void *nlist;
 		if (snd_BUG_ON(num >= 4096))
 			return NULL;
-		nlist = krealloc(array->list, size, GFP_KERNEL);
+		nlist = krealloc(array->list, size, GFP_KERNEL | __GFP_ZERO);
 		if (!nlist)
 			return NULL;
-		memset(nlist + oldsize, 0, size - oldsize);
 		array->list = nlist;
 		array->alloced = num;
 	}