From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753273AbbFDNeD (ORCPT ); Thu, 4 Jun 2015 09:34:03 -0400 Received: from mga02.intel.com ([134.134.136.20]:21331 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752081AbbFDNeC (ORCPT ); Thu, 4 Jun 2015 09:34:02 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,552,1427785200"; d="scan'208";a="705282149" From: Alexander Shishkin To: Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, Paul Mackerras , adrian.hunter@intel.com, x86@kernel.org, hpa@zytor.com, acme@infradead.org, Alexander Shishkin Subject: [PATCH] perf/x86/intel/pt: Fix a refactoring glitch Date: Thu, 4 Jun 2015 16:31:47 +0300 Message-Id: <1433424707-12557-1-git-send-email-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 066450be41 ("perf/x86/intel/pt: Clean up the control flow in pt_pmu_hw_init()") changed attribute initialization so that only the first attribute gets initialized using sysfs_attr_init(), which upsets lockdep. This patch fixes the glitch so that all allocated attributes are properly initialized thus fixing the lockdep warning reported by Tvrtko and Imre. Signed-off-by: Alexander Shishkin Reported-by: Tvrtko Ursulin Reported-by: Imre Deak --- arch/x86/kernel/cpu/perf_event_intel_pt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/perf_event_intel_pt.c b/arch/x86/kernel/cpu/perf_event_intel_pt.c index ccdda1311e..7ef69b2c46 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_pt.c +++ b/arch/x86/kernel/cpu/perf_event_intel_pt.c @@ -197,7 +197,7 @@ static int __init pt_pmu_hw_init(void) de_attr->attr.attr.name = pt_caps[i].name; - sysfs_attr_init(&de_attrs->attr.attr); + sysfs_attr_init(&de_attr->attr.attr); de_attr->attr.attr.mode = S_IRUGO | S_IWUSR; de_attr->attr.store = pt_cap_store; -- 2.1.4