From patchwork Tue Feb 1 17:37:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 523561 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p11Hc9Ri011084 for ; Tue, 1 Feb 2011 17:38:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755691Ab1BARhy (ORCPT ); Tue, 1 Feb 2011 12:37:54 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:36966 "EHLO relmlor1.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755592Ab1BARhw convert rfc822-to-8bit (ORCPT ); Tue, 1 Feb 2011 12:37:52 -0500 Received: from relmlir2.idc.renesas.com ([10.200.68.152]) by relmlor1.idc.renesas.com ( SJSMS) with ESMTP id <0LFY00MQH8Z2S660@relmlor1.idc.renesas.com> for linux-sh@vger.kernel.org; Wed, 02 Feb 2011 02:37:50 +0900 (JST) Received: from relmlac1.idc.renesas.com ([10.200.69.21]) by relmlir2.idc.renesas.com ( SJSMS) with ESMTP id <0LFY00D6Z8Z286A0@relmlir2.idc.renesas.com> for linux-sh@vger.kernel.org; Wed, 02 Feb 2011 02:37:50 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id A409780088; Wed, 02 Feb 2011 02:37:50 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 9E2B580030 for ; Wed, 02 Feb 2011 02:37:50 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id CAB30069; Wed, 02 Feb 2011 02:37:50 +0900 X-IronPort-AV: E=Sophos;i="4.60,411,1291561200"; d="scan'208";a="9364343" Received: from unknown (HELO rte-idc-bh1.RTE.ADWIN.RENESAS.COM) ([172.28.64.243]) by relmlii2.idc.renesas.com with ESMTP; Wed, 02 Feb 2011 02:37:49 +0900 Received: from rte-ben-exch.RTE.ADWIN.RENESAS.COM ([172.28.0.16]) by rte-idc-bh1.RTE.ADWIN.RENESAS.COM with Microsoft SMTPSVC(6.0.3790.211) ; Tue, 01 Feb 2011 17:37:44 +0000 X-MIMEOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-version: 1.0 Subject: [PATCH] sh: Fix ptrace FPU state initialisation Date: Tue, 01 Feb 2011 17:37:36 +0000 Message-id: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-topic: [PATCH] sh: Fix ptrace FPU state initialisation Thread-index: AcvCNrdJRA4IU5yhRiO0dymZdljDKw== From: Phil Edworthy To: linux-sh@vger.kernel.org X-OriginalArrivalTime: 01 Feb 2011 17:37:44.0693 (UTC) FILETIME=[BBEAA250:01CBC236] Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 01 Feb 2011 17:38:09 +0000 (UTC) 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);