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


Groups > linux.kernel > #1327337 > unrolled thread

[PATCH] pvrusb2: correctly handling failed thread run

Started byInsu Yun <wuninsu@gmail.com>
First post2016-02-05 00:20 +0100
Last post2016-02-05 00:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] pvrusb2: correctly handling failed thread run Insu Yun <wuninsu@gmail.com> - 2016-02-05 00:20 +0100

#1327337 — [PATCH] pvrusb2: correctly handling failed thread run

FromInsu Yun <wuninsu@gmail.com>
Date2016-02-05 00:20 +0100
Subject[PATCH] pvrusb2: correctly handling failed thread run
Message-ID<qYBlT-lJ-15@gated-at.bofh.it>
Since kthread_run returns -ENOMEM if failed,
it needs to be checked whether it is error, not whether it is null.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
 drivers/media/usb/pvrusb2/pvrusb2-context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c
index fd888a6..aabdc58 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-context.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c
@@ -196,7 +196,7 @@ int pvr2_context_global_init(void)
 	pvr2_context_thread_ptr = kthread_run(pvr2_context_thread_func,
 					      NULL,
 					      "pvrusb2-context");
-	return (pvr2_context_thread_ptr ? 0 : -ENOMEM);
+	return IS_ERR(pvr2_context_thread_ptr) ? -ENOMEM : 0;
 }
 
 
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web