Merge commit 'v3.14' into next
[firefly-linux-kernel-4.4.55.git] / arch / powerpc / kernel / signal_32.c
index 6ce69e6f1fcb8c4557bb3e19af8d8111ad51a4ae..a67e00aa3caad1353630f4477a8cec38fb8461e4 100644 (file)
@@ -1022,29 +1022,24 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
        tm_frame = &rt_sf->uc_transact.uc_mcontext;
        if (MSR_TM_ACTIVE(regs->msr)) {
+               if (__put_user((unsigned long)&rt_sf->uc_transact,
+                              &rt_sf->uc.uc_link) ||
+                   __put_user((unsigned long)tm_frame,
+                              &rt_sf->uc_transact.uc_regs))
+                       goto badframe;
                if (save_tm_user_regs(regs, frame, tm_frame, sigret))
                        goto badframe;
        }
        else
 #endif
        {
+               if (__put_user(0, &rt_sf->uc.uc_link))
+                       goto badframe;
                if (save_user_regs(regs, frame, tm_frame, sigret, 1))
                        goto badframe;
        }
        regs->link = tramp;
 
-#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
-       if (MSR_TM_ACTIVE(regs->msr)) {
-               if (__put_user((unsigned long)&rt_sf->uc_transact,
-                              &rt_sf->uc.uc_link)
-                   || __put_user((unsigned long)tm_frame, &rt_sf->uc_transact.uc_regs))
-                       goto badframe;
-       }
-       else
-#endif
-               if (__put_user(0, &rt_sf->uc.uc_link))
-                       goto badframe;
-
        current->thread.fp_state.fpscr = 0;     /* turn off all fp exceptions */
 
        /* create a stack frame for the caller of the handler */