lkml.org 
[lkml]   [2016]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] aoe: remove unnecessary check for failing kthread creation
From
Date
On 02/01/2016 10:53 AM, Insu Yun wrote:
> When kthread_run fails, it returns ERR, not NULL.
> Therefore, NULL checking is redundant.
> (https://www.kernel.org/doc/htmldocs/device-drivers/API-kthread-run.html)

Thanks, the change looks reasonable.

...
> task = kthread_run(kthread, k, "%s", k->name);
> - if (task == NULL || IS_ERR(task))
> + if (IS_ERR(task))
> return -ENOMEM;

Interestingly, after this change, it's more clear that returning
-ENOMEM is a bit misleading when the underlying kernel/kthread.c
function, kthread_create_on_node returns ERR_PTR(-EINTR). But because
that would happen when the process we need to have the driver working
gets killed, I'm not sure it matters.

--
Ed

\
 
 \ /
  Last update: 2016-02-03 03:01    [W:0.222 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site