Merge branch 'exit-cleanups-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / arch / powerpc / kernel / signal_32.c
index 38c3eae40c145090cb8fa692da97d8356b494437..00a9c9cd6d421c4fc1536fdb9e527cd9e78a45a6 100644 (file)
@@ -1062,8 +1062,10 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
         * or if another thread unmaps the region containing the context.
         * We kill the task with a SIGSEGV in this situation.
         */
-       if (do_setcontext(new_ctx, regs, 0))
-               do_exit(SIGSEGV);
+       if (do_setcontext(new_ctx, regs, 0)) {
+               force_fatal_sig(SIGSEGV);
+               return -EFAULT;
+       }
 
        set_thread_flag(TIF_RESTOREALL);
        return 0;