Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1491517

[PATCH] perf/bts: Don't try handling BTS interrupt if BTS is not enabled

From Boris Ostrovsky <boris.ostrovsky@oracle.com>
Newsgroups linux.kernel
Subject [PATCH] perf/bts: Don't try handling BTS interrupt if BTS is not enabled
Date 2016-09-26 21:30 +0200
Message-ID <slJLc-7R2-27@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Otherwise we will try to dereference ds which has not been allocated.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] perf/bts: Don't try handling BTS interrupt if BTS is not enabled Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-09-26 21:30 +0200
  Re: [PATCH] perf/bts: Don't try handling BTS interrupt if BTS is not enabled Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-26 23:10 +0200

csiph-web