diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-10-10 08:59:14 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-10-10 09:24:08 +0200 |
commit | 12f1771709ea53f11cf633c065d6160769795f24 (patch) | |
tree | ec0ab0dcbdf3fd747b886614cf285b9262656edb /sound/pci/hda/hda_codec.c | |
parent | b2cbf3b30e6d1237f8864c4c9123f2a68cdfedf6 (diff) | |
download | blackbird-obmc-linux-12f1771709ea53f11cf633c065d6160769795f24.tar.gz blackbird-obmc-linux-12f1771709ea53f11cf633c065d6160769795f24.zip |
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index c0ab72cbeed1..70d4848b5cd0 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -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; |