[PATCH next] kthread: Fix a NULL vs IS_ERR() bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The kthread_create_worker_on_node() function returns error pointers,
never NULL.  Fix the check to match.

Fixes: e9853c812f86 ("treewide: Introduce kthread_run_worker[_on_cpu]()")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
 kernel/kthread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/kthread.c b/kernel/kthread.c
index 83bf73d2355c..922f15762ec3 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -1124,7 +1124,7 @@ kthread_create_worker_on_cpu(int cpu, unsigned int flags,
 	struct kthread_worker *worker;
 
 	worker = kthread_create_worker_on_node(flags, cpu_to_node(cpu), namefmt, cpu);
-	if (worker)
+	if (!IS_ERR(worker))
 		kthread_bind(worker->task, cpu);
 
 	return worker;
-- 
2.45.2





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux