Skip to content

Commit

Permalink
ALSA: emu10k1: correctly handling failed thread creation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Insu Yun authored and Takashi Iwai committed Jan 29, 2016
1 parent 1b3c993 commit f1d5159
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sound/pci/emu10k1/emu10k1_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit f1d5159

Please sign in to comment.