Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751522AbZCFJf6 (ORCPT ); Fri, 6 Mar 2009 04:35:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750876AbZCFJfs (ORCPT ); Fri, 6 Mar 2009 04:35:48 -0500 Received: from bilbo.ozlabs.org ([203.10.76.25]:42098 "EHLO bilbo.ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750810AbZCFJfr (ORCPT ); Fri, 6 Mar 2009 04:35:47 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18864.61033.280502.291018@cargo.ozlabs.ibm.com> Date: Fri, 6 Mar 2009 20:35:37 +1100 From: Paul Mackerras To: Ingo Molnar CC: linux-kernel@vger.kernel.org, Thomas Gleixner , Peter Zijlstra Subject: [PATCH 1/3] perfcounters/powerpc: fix oops with multiple counters in a group X-Mailer: VM 8.0.9 under Emacs 22.2.1 (i486-pc-linux-gnu) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1278 Lines: 37 Impact: fix oops-causing bug This fixes a bug in the powerpc hw_perf_counter_init where the code didn't initialize ctrs[n] before passing the ctrs array to check_excludes, leading to possible oopses and other incorrect behaviour. This fixes it by initializing ctrs[n] correctly. Signed-off-by: Paul Mackerras --- Ingo, please pull this series of 3 patches from my perfcounters.git master branch at: git://git.kernel.org/pub/scm/linux/kernel/git/paulus/perfcounters.git master arch/powerpc/kernel/perf_counter.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c index 112332d..4fec112 100644 --- a/arch/powerpc/kernel/perf_counter.c +++ b/arch/powerpc/kernel/perf_counter.c @@ -633,6 +633,7 @@ hw_perf_counter_init(struct perf_counter *counter) return NULL; } events[n] = ev; + ctrs[n] = counter; if (check_excludes(ctrs, n, 1)) return NULL; if (power_check_constraints(events, n + 1)) -- 1.5.6.3 -- 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/