Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751387AbbFMXJk (ORCPT ); Sat, 13 Jun 2015 19:09:40 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:34857 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbbFMXJb (ORCPT ); Sat, 13 Jun 2015 19:09:31 -0400 From: Max Filippov To: Mischa Jonker , Vineet Gupta Cc: linux-kernel@vger.kernel.org, Max Filippov Subject: arc_pmu not initialized in the arc/kernel/perf_event.c? Date: Sun, 14 Jun 2015 02:09:06 +0300 Message-Id: <1434236946-15326-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.8.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1386 Lines: 42 Mischa, Vineet, Looking at ARC PMU driver I've got an impression that its static arc_pmu is left uninitialized, which possibly leads to Oops once registered callbacks are invoked. I don't have neither ARC toolchain nor hardware to test it, so I may be missing something. Below is the fix for it. Thanks. -- Max ---8<--- From: Max Filippov Subject: [PATCH] arc: fix use of uninitialized arc_pmu static arc_pmu in the arch/arc/kernel/perf_event.c is not initialized as it's shadowed by a local variable of the same name in the arc_pmu_device_probe. Signed-off-by: Max Filippov --- arch/arc/kernel/perf_event.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c index fd2ec50..57b58f5 100644 --- a/arch/arc/kernel/perf_event.c +++ b/arch/arc/kernel/perf_event.c @@ -266,7 +266,6 @@ static int arc_pmu_add(struct perf_event *event, int flags) static int arc_pmu_device_probe(struct platform_device *pdev) { - struct arc_pmu *arc_pmu; struct arc_reg_pct_build pct_bcr; struct arc_reg_cc_build cc_bcr; int i, j, ret; -- 1.8.1.4 -- 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/