Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-08-03 14:03:49 +0200
committerTakashi Iwai <tiwai@suse.de>2018-08-03 14:04:18 +0200
commit7b8a16475da0bff08afcf55f5012db32eba1e54b (patch)
tree499c9aa1f5bc7fcb2a39f38c6c5aa851c3b06d58
parent4c3d502b829a5c236cc7ba344f1f7f251bf5dae6 (diff)
ALSA: fm801: add error handling for snd_ctl_add (bsc#1051510).
-rw-r--r--sound/pci/fm801.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index a178e0d03088..8561f60b4284 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1068,11 +1068,19 @@ static int snd_fm801_mixer(struct fm801 *chip)
if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97_sec)) < 0)
return err;
}
- for (i = 0; i < FM801_CONTROLS; i++)
- snd_ctl_add(chip->card, snd_ctl_new1(&snd_fm801_controls[i], chip));
+ for (i = 0; i < FM801_CONTROLS; i++) {
+ err = snd_ctl_add(chip->card,
+ snd_ctl_new1(&snd_fm801_controls[i], chip));
+ if (err < 0)
+ return err;
+ }
if (chip->multichannel) {
- for (i = 0; i < FM801_CONTROLS_MULTI; i++)
- snd_ctl_add(chip->card, snd_ctl_new1(&snd_fm801_controls_multi[i], chip));
+ for (i = 0; i < FM801_CONTROLS_MULTI; i++) {
+ err = snd_ctl_add(chip->card,
+ snd_ctl_new1(&snd_fm801_controls_multi[i], chip));
+ if (err < 0)
+ return err;
+ }
}
return 0;
}