Path: csiph.com!aioe.org!bofh.it!news.nic.it!robomod From: Max Filippov Newsgroups: linux.kernel Subject: arc_pmu not initialized in the arc/kernel/perf_event.c? Date: Sun, 14 Jun 2015 01:10:02 +0200 Message-ID: X-Original-To: Mischa Jonker , Vineet Gupta Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=4iaE+RQrKmy8COd+WKwT4vDIOFD3zy9IJegqD0nZ4zo=; b=h2EbeMstfFuyQDsbzZsDOjiBwnfs3kwJtCK70+VvyuwhwvSJ8VDEdGEZXhhYWdVipP +UF61pl9O4zQBL/rzyt9czA6b/PxqlG8Njg3qED2IcgYiIB00MAWIYE/P3qTE91uwDDW tDbtpv7JPliJ8ZZmUmOS+PHWS5vrlUiwnbGi7NpLKgHjfJihoN8yYCVZZyokLn6+g+fN jV6cVb2sNZjsB45ixDOV31pQ2EK5Fr5/gZQpr4AggnTLnPxwjf85ZpwGKY9Rc5j+9X0K JGdIfgqaDrLZn04fWIXAausWc0XoBB+zWLXli9bGvnmEjAqATSakE6wC84mZj5llBjGe GBVA== X-Received: by 10.112.27.238 with SMTP id w14mr21284293lbg.80.1434236969543; Sat, 13 Jun 2015 16:09:29 -0700 (PDT) X-Mailer: git-send-email 1.8.1.4 Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 42 Organization: linux.* mail to news gateway X-Original-Cc: linux-kernel@vger.kernel.org, Max Filippov X-Original-Date: Sun, 14 Jun 2015 02:09:06 +0300 X-Original-Message-ID: <1434236946-15326-1-git-send-email-jcmvbkbc@gmail.com> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: aioe.org linux.kernel:1164723 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/