From: Insu Yun Date: Thu, 4 Feb 2016 23:09:23 +0000 (-0200) Subject: [media] pvrusb2: correctly handling failed thread run X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bb07df8ae18b42a8c5aea715fae82938b467ff9d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [media] 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. Signed-off-by: Insu Yun Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c index fd888a604462..c45f30715dcd 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; }