Skip to contentSkip to conversation

pvrusb2: correctly handling failed thread run

PATCH New Insu Yun 1 participant 1 message Feb 4, 2016

Subsystems (2)
lore
Share & tools
lore

Insu Yun

author
#0 lore raw

PATCH 1/1 pvrusb2: correctly handling failed thread run

Since kthread_run returns -ENOMEM if failed,
it needs to be checked whether it is error, not whether it is null.

---
 drivers/media/usb/pvrusb2/pvrusb2-context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/pvrusb2/pvrusb2-context.c +1 -1
index fd888a6..aabdc58 100644
@@ -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;
 }
 
 
Signature · 1 line
1.9.1