Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1321851 > unrolled thread

[PATCH v2] emu10k1: correctly handling failed thread creation

Started byInsu Yun <wuninsu@gmail.com>
First post2016-01-29 17:00 +0100
Last post2016-01-29 17:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] emu10k1: correctly handling failed thread creation Insu Yun <wuninsu@gmail.com> - 2016-01-29 17:00 +0100
    Re: [alsa-devel] [PATCH v2] emu10k1: correctly handling failed thread creation Takashi Iwai <tiwai@suse.de> - 2016-01-29 17:40 +0100

#1321851 — [PATCH v2] emu10k1: correctly handling failed thread creation

FromInsu Yun <wuninsu@gmail.com>
Date2016-01-29 17:00 +0100
Subject[PATCH v2] emu10k1: correctly handling failed thread creation
Message-ID<qWjCP-5kt-45@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1321880 — Re: [alsa-devel] [PATCH v2] emu10k1: correctly handling failed thread creation

FromTakashi Iwai <tiwai@suse.de>
Date2016-01-29 17:40 +0100
SubjectRe: [alsa-devel] [PATCH v2] emu10k1: correctly handling failed thread creation
Message-ID<qWkfw-5Sw-33@gated-at.bofh.it>
In reply to#1321851
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
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web