diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 135fc73e2e5d..824e2e3f07dd 100644 --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c @@ -312,7 +312,11 @@ static bool klp_try_switch_task(struct task_struct *task) * functions. If all goes well, switch the task to the target patch * state. */ - ret = task_call_func(task, klp_check_and_switch_task, &old_name); + if (task == current) + ret = klp_check_and_switch_task(current, &old_name); + else + ret = task_call_func(task, klp_check_and_switch_task, &old_name); + switch (ret) { case 0: /* success */ break;