Skip to content

Commit

Permalink
perf/x86/intel/uncore: Fix wrong box pointer check
Browse files Browse the repository at this point in the history
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: fff4b87 ("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>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20170629190926.2456-1-kan.liang@intel.com
  • Loading branch information
Kan Liang authored and Thomas Gleixner committed Jun 29, 2017
1 parent 98fe363 commit 80c65fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/events/intel/uncore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ static int uncore_event_cpu_online(unsigned int cpu)
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);
}
}
Expand Down

0 comments on commit 80c65fd

Please sign in to comment.