diff options
author | Insu Yun <wuninsu@gmail.com> | 2016-01-29 10:56:11 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-01-29 17:30:25 +0100 |
commit | f1d51595a2a54d725cd6a21dd54508335a14ab90 (patch) | |
tree | 59bbee1adbc2d2f766b46242a13d0dafd574d5d5 /sound | |
parent | 1b3c993a699bed282e47c3f7c49d539c331dae04 (diff) | |
download | linux-f1d51595a2a54d725cd6a21dd54508335a14ab90.tar.bz2 |
ALSA: emu10k1: correctly handling failed thread creation
Since kthread_create can be failed, it needs to check
whether error occurred and return error code.
Signed-off-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/emu10k1/emu10k1_main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 28e2f8b42f5e..891453451543 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -1141,6 +1141,14 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu) emu->emu1010.firmware_thread = kthread_create(emu1010_firmware_thread, emu, "emu1010_firmware"); + if (IS_ERR(emu->emu1010.firmware_thread)) { + err = PTR_ERR(emu->emu1010.firmware_thread); + emu->emu1010.firmware_thread = NULL; + dev_info(emu->card->dev, + "emu1010: Creating thread failed\n"); + return err; + } + wake_up_process(emu->emu1010.firmware_thread); } |