diff options
author | Zhouyang Jia <jiazhouyang09@gmail.com> | 2018-06-11 16:18:40 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-03 07:55:13 +0200 |
commit | 9f9e506d8e6912c5b648288e68e6e442d6d9e2d7 (patch) | |
tree | 790b636b964588eee5b875af2e8d26ce66cbe228 /sound | |
parent | acd9aba8e481eaf88799bfba33590c1f5c322eb2 (diff) | |
download | linux-stable-9f9e506d8e6912c5b648288e68e6e442d6d9e2d7.tar.gz linux-stable-9f9e506d8e6912c5b648288e68e6e442d6d9e2d7.tar.bz2 linux-stable-9f9e506d8e6912c5b648288e68e6e442d6d9e2d7.zip |
ALSA: emu10k1: add error handling for snd_ctl_add
[ Upstream commit 6d531e7b972cb62ded011c2dfcc2d9f72ea6c421 ]
When snd_ctl_add fails, the lack of error-handling code may
cause unexpected results.
This patch adds error-handling code after calling snd_ctl_add.
Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/emu10k1/emupcm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index 37be1e14d756..0d2bb30d9f7e 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c @@ -1850,7 +1850,9 @@ int snd_emu10k1_pcm_efx(struct snd_emu10k1 *emu, int device) if (!kctl) return -ENOMEM; kctl->id.device = device; - snd_ctl_add(emu->card, kctl); + err = snd_ctl_add(emu->card, kctl); + if (err < 0) + return err; snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024); |