]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: ac97 - Fix missing NULL check in snd_ac97_cvol_new()
authorTakashi Iwai <tiwai@suse.de>
Thu, 11 Oct 2012 14:43:40 +0000 (16:43 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 30 Oct 2012 23:27:09 +0000 (23:27 +0000)
commit 733a48e5ae5bf28b046fad984d458c747cbb8c21 upstream.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=44721

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/pci/ac97/ac97_codec.c

index fac51eef2725d9ad7e64727a6dcb6f02e20019f9..1e7cfba61c49f2f2a8d2cf45ebea1db28b572453 100644 (file)
@@ -1271,6 +1271,8 @@ static int snd_ac97_cvol_new(struct snd_card *card, char *name, int reg, unsigne
                tmp.index = ac97->num;
                kctl = snd_ctl_new1(&tmp, ac97);
        }
+       if (!kctl)
+               return -ENOMEM;
        if (reg >= AC97_PHONE && reg <= AC97_PCM)
                set_tlv_db_scale(kctl, db_scale_5bit_12db_max);
        else