diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-10-11 16:43:40 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-10-15 09:55:48 +0200 |
commit | 733a48e5ae5bf28b046fad984d458c747cbb8c21 (patch) | |
tree | f994ea76d4cd5a04e425bc5fbdf1be1443c3ae7d /sound/pci | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (diff) |
ALSA: ac97 - Fix missing NULL check in snd_ac97_cvol_new()
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=44721
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/ac97/ac97_codec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 9473fca9681..8b0f9968830 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -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 |