Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753159AbZJQJ7y (ORCPT ); Sat, 17 Oct 2009 05:59:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752732AbZJQJ7x (ORCPT ); Sat, 17 Oct 2009 05:59:53 -0400 Received: from hera.kernel.org ([140.211.167.34]:36261 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752704AbZJQJ7w (ORCPT ); Sat, 17 Oct 2009 05:59:52 -0400 Date: Sat, 17 Oct 2009 09:59:07 GMT From: tip-bot for Masami Hiramatsu Cc: mingo@redhat.com, peterz@infradead.org, fweisbec@gmail.com, rostedt@goodmis.org, ak@linux.intel.com, jbaron@redhat.com, tglx@linutronix.de, laijs@cn.fujitsu.com, mhiramat@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, fche@redhat.com, jkenisto@us.ibm.com, tzanussi@gmail.com, lizf@cn.fujitsu.com, hch@infradead.org, ananth@in.ibm.com, srikar@linux.vnet.ibm.com, mingo@elte.hu, prasad@linux.vnet.ibm.com Reply-To: mingo@redhat.com, peterz@infradead.org, fweisbec@gmail.com, rostedt@goodmis.org, ak@linux.intel.com, jbaron@redhat.com, tglx@linutronix.de, laijs@cn.fujitsu.com, mhiramat@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, fche@redhat.com, jkenisto@us.ibm.com, tzanussi@gmail.com, lizf@cn.fujitsu.com, hch@infradead.org, ananth@in.ibm.com, srikar@linux.vnet.ibm.com, mingo@elte.hu, prasad@linux.vnet.ibm.com In-Reply-To: <20090910235306.22412.31613.stgit@dhcp-100-2-132.bos.redhat.com> References: <20090910235306.22412.31613.stgit@dhcp-100-2-132.bos.redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/probes] x86/ptrace: Fix regs_get_argument_nth() to add correct offset Message-ID: Git-Commit-ID: ad5cafcdb09c57008c990edd309c0a563b09f238 X-Mailer: tip-git-log-daemon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Sat, 17 Oct 2009 09:59:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2284 Lines: 55 Commit-ID: ad5cafcdb09c57008c990edd309c0a563b09f238 Gitweb: http://git.kernel.org/tip/ad5cafcdb09c57008c990edd309c0a563b09f238 Author: Masami Hiramatsu AuthorDate: Thu, 10 Sep 2009 19:53:06 -0400 Committer: Frederic Weisbecker CommitDate: Fri, 11 Sep 2009 04:14:24 +0200 x86/ptrace: Fix regs_get_argument_nth() to add correct offset Fix regs_get_argument_nth() to add correct offset bytes. Because offset_of() returns offset in byte, the offset should be added to char * instead of unsigned long *. Signed-off-by: Masami Hiramatsu Acked-by: Steven Rostedt Cc: Jim Keniston Cc: Ananth N Mavinakayanahalli Cc: Andi Kleen Cc: Christoph Hellwig Cc: Frank Ch. Eigler Cc: Frederic Weisbecker Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Jason Baron Cc: K.Prasad Cc: Lai Jiangshan Cc: Li Zefan Cc: Peter Zijlstra Cc: Srikar Dronamraju Cc: Steven Rostedt Cc: Tom Zanussi LKML-Reference: <20090910235306.22412.31613.stgit@dhcp-100-2-132.bos.redhat.com> Signed-off-by: Frederic Weisbecker --- arch/x86/kernel/ptrace.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index a33a17d..caffb68 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c @@ -150,7 +150,7 @@ static const int arg_offs_table[] = { unsigned long regs_get_argument_nth(struct pt_regs *regs, unsigned int n) { if (n < ARRAY_SIZE(arg_offs_table)) - return *((unsigned long *)regs + arg_offs_table[n]); + return *(unsigned long *)((char *)regs + arg_offs_table[n]); else { /* * The typical case: arg n is on the stack. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/