Commit 12f17717 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Warn an allocation for an uninitialized array

Better to add a sanity check as I tend to forget something (especially
during crazy midsummer nights).
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent b2cbf3b3
......@@ -5168,6 +5168,8 @@ EXPORT_SYMBOL_HDA(snd_hda_resume);
*/
void *snd_array_new(struct snd_array *array)
{
if (snd_BUG_ON(!array->elem_size))
return NULL;
if (array->used >= array->alloced) {
int num = array->alloced + array->alloc_align;
int size = (num + 1) * array->elem_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment