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


Groups > linux.kernel > #1680084 > unrolled thread

[PATCH 4.11 48/84] perf/x86/intel/uncore: Fix wrong box pointer check

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-07-03 15:50 +0200
Last post2017-07-03 15:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.11 48/84] perf/x86/intel/uncore: Fix wrong box pointer check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-03 15:50 +0200

#1680084 — [PATCH 4.11 48/84] perf/x86/intel/uncore: Fix wrong box pointer check

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-03 15:50 +0200
Subject[PATCH 4.11 48/84] perf/x86/intel/uncore: Fix wrong box pointer check
Message-ID<tZ9TK-2c1-81@gated-at.bofh.it>
4.11-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kan Liang <kan.liang@intel.com>

commit 80c65fdb4c6920e332a9781a3de5877594b07522 upstream.

Should not init a NULL box. It will cause system crash.
The issue looks like caused by a typo.

This was not noticed because there is no NULL box. Also, for most
boxes, they are enabled by default. The init code is not critical.

Fixes: fff4b87e594a ("perf/x86/intel/uncore: Make package handling more robust")
Signed-off-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170629190926.2456-1-kan.liang@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/events/intel/uncore.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -1170,7 +1170,7 @@ static int uncore_event_cpu_online(unsig
 		pmu = type->pmus;
 		for (i = 0; i < type->num_boxes; i++, pmu++) {
 			box = pmu->boxes[pkg];
-			if (!box && atomic_inc_return(&box->refcnt) == 1)
+			if (box && atomic_inc_return(&box->refcnt) == 1)
 				uncore_box_init(box);
 		}
 	}

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web