Skip to content

Commit

Permalink
ALSA: hda - Warn an allocation for an uninitialized array
Browse files Browse the repository at this point in the history
Better to add a sanity check as I tend to forget something (especially
during crazy midsummer nights).

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Oct 10, 2012
1 parent b2cbf3b commit 12f1771
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 12f1771

Please sign in to comment.