From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161404AbcIZTZO (ORCPT ); Mon, 26 Sep 2016 15:25:14 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:16940 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965069AbcIZTZM (ORCPT ); Mon, 26 Sep 2016 15:25:12 -0400 From: Boris Ostrovsky To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org Cc: alexander.shishkin@linux.intel.com, peterz@infradead.org, bp@suse.de, linux-kernel@vger.kernel.org, boris.ostrovsky@oracle.com Subject: [PATCH] perf/bts: Don't try handling BTS interrupt if BTS is not enabled Date: Mon, 26 Sep 2016 15:19:06 -0400 Message-Id: <1474917546-13772-1-git-send-email-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Otherwise we will try to dereference ds which has not been allocated. Signed-off-by: Boris Ostrovsky --- arch/x86/events/intel/bts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c index bdcd651..1f5657f 100644 --- a/arch/x86/events/intel/bts.c +++ b/arch/x86/events/intel/bts.c @@ -451,6 +451,9 @@ int intel_bts_interrupt(void) s64 old_head; int err = -ENOSPC, handled = 0; + if (!x86_pmu.bts) + return 0; + /* * The only surefire way of knowing if this NMI is ours is by checking * the write ptr against the PMI threshold. -- 1.8.3.1