diff mbox

sh: Fix ptrace FPU state initialisation

Message ID AB12B32E73474741A2C5361C433A44DE02911887@rte-ben-exch.RTE.ADWIN.RENESAS.COM (mailing list archive)
State Superseded
Headers show

Commit Message

Phil Edworthy Feb. 1, 2011, 5:37 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index 6c4bbba..df0144c 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -363,9 +363,13 @@  long arch_ptrace(struct task_struct *child, long
request, long addr, long data)
 					tmp = FPSCR_INIT;
 				else
 					tmp = 0;
-			} else
+			} else {
+				ret = init_fpu(child);
+				if (ret)
+					break;
 				tmp = ((long *)child->thread.xstate)
 					[(addr - (long)&dummy->fpu) >> 2];
+			}
 		} else if (addr == (long) &dummy->u_fpvalid)
 			tmp = !!tsk_used_math(child);