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


Groups > linux.kernel > #1731658

[PATCH] uwb: properly check kthread_run return value

From Andrey Konovalov <andreyknvl@google.com>
Newsgroups linux.kernel
Subject [PATCH] uwb: properly check kthread_run return value
Date 2017-09-13 17:10 +0200
Message-ID <uphsD-wM-29@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


uwbd_start() calls kthread_run() and checks that the return value is
not NULL. But the return value is not NULL in case kthread_run() fails,
it takes the form of ERR_PTR(-EINTR).

Use IS_ERR() instead.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
---
 drivers/uwb/uwbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/uwb/uwbd.c b/drivers/uwb/uwbd.c
index 01c20a260a8b..9f615b303576 100644
--- a/drivers/uwb/uwbd.c
+++ b/drivers/uwb/uwbd.c
@@ -303,7 +303,7 @@ static int uwbd(void *param)
 void uwbd_start(struct uwb_rc *rc)
 {
 	rc->uwbd.task = kthread_run(uwbd, rc, "uwbd");
-	if (rc->uwbd.task == NULL)
+	if (IS_ERR(rc->uwbd.task))
 		printk(KERN_ERR "UWB: Cannot start management daemon; "
 		       "UWB won't work\n");
 	else
-- 
2.14.1.581.gf28d330327-goog

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


Thread

[PATCH] uwb: properly check kthread_run return value Andrey Konovalov <andreyknvl@google.com> - 2017-09-13 17:10 +0200
  Re: [PATCH] uwb: properly check kthread_run return value Andrey Konovalov <andreyknvl@google.com> - 2017-09-13 18:10 +0200

csiph-web