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


Groups > linux.kernel > #1321508

Re: [PATCH] emu10k1: correctly handling failed thread creation

From Takashi Iwai <tiwai@suse.de>
Newsgroups linux.kernel
Subject Re: [PATCH] emu10k1: correctly handling failed thread creation
Date 2016-01-29 07:40 +0100
Message-ID <qWaSS-7bs-13@gated-at.bofh.it> (permalink)
References <qW4u6-2pQ-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 29 Jan 2016 00:51:37 +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>
> ---
>  sound/pci/emu10k1/emu10k1_main.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
> index 28e2f8b..b9eac15 100644
> --- a/sound/pci/emu10k1/emu10k1_main.c
> +++ b/sound/pci/emu10k1/emu10k1_main.c
> @@ -1141,6 +1141,12 @@ 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)) {
> +			dev_info(emu->card->dev,
> +					"emu1010: Creating thread failed\n");
> +			return PTR_ERR(emu->emu1010.firmware_thread);

It needs to NULL-clear emu->emu1010.firmware_thread after this, since
kthread_stop() is called for non-NULL case in the destructor.  Could
you fix it and resubmit?


thanks,

Takashi

> +		}
> +
>  		wake_up_process(emu->emu1010.firmware_thread);
>  	}
>  
> -- 
> 1.9.1
> 
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

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

csiph-web