Commit f1d51595 authored by Insu Yun's avatar Insu Yun Committed by Takashi Iwai

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: default avatarInsu Yun <wuninsu@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 1b3c993a
...@@ -1141,6 +1141,14 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu) ...@@ -1141,6 +1141,14 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
emu->emu1010.firmware_thread = emu->emu1010.firmware_thread =
kthread_create(emu1010_firmware_thread, emu, kthread_create(emu1010_firmware_thread, emu,
"emu1010_firmware"); "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); wake_up_process(emu->emu1010.firmware_thread);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment