projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
ALSA: ac97 - Fix missing NULL check in snd_ac97_cvol_new()
[firefly-linux-kernel-4.4.55.git]
/
sound
/
pci
/
ac97
/
ac97_codec.c
diff --git
a/sound/pci/ac97/ac97_codec.c
b/sound/pci/ac97/ac97_codec.c
index 9473fca9681dd7e291595501a6270c47793aa3bc..8b0f996883034c4b99b4823ea7a6f01b6d064587 100644
(file)
--- 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