* [PATCH v2] emu10k1: correctly handling failed thread creation
@ 2016-01-29 15:56 Insu Yun
2016-01-29 16:31 ` [alsa-devel] " Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Insu Yun @ 2016-01-29 15:56 UTC (permalink / raw)
To: perex, tiwai, michael, lambert.quentin, pzubaj, alsa-devel,
linux-kernel
Cc: taesoo, yeongjin.jang, insu, changwoo, Insu Yun
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>
---
sound/pci/emu10k1/emu10k1_main.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 28e2f8b..8914534 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);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [alsa-devel] [PATCH v2] emu10k1: correctly handling failed thread creation
2016-01-29 15:56 [PATCH v2] emu10k1: correctly handling failed thread creation Insu Yun
@ 2016-01-29 16:31 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2016-01-29 16:31 UTC (permalink / raw)
To: Insu Yun
Cc: perex, tiwai, michael, lambert.quentin, pzubaj, alsa-devel,
linux-kernel, yeongjin.jang, taesoo, insu, changwoo
On Fri, 29 Jan 2016 16:56:11 +0100,
Insu Yun wrote:
>
> 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>
Applied, thanks.
Takashi
> ---
> sound/pci/emu10k1/emu10k1_main.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
> index 28e2f8b..8914534 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);
> }
>
> --
> 1.9.1
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-29 16:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-29 15:56 [PATCH v2] emu10k1: correctly handling failed thread creation Insu Yun
2016-01-29 16:31 ` [alsa-devel] " Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).