From: Vincent Stehlé Date: Tue, 24 May 2016 14:53:49 +0000 (+0200) Subject: perf/x86/intel/rapl: Fix pmus free during cleanup X-Git-Tag: v4.6.5~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c49c99f65b5ffa1397a26dc5c8c0a1ca961c2565;p=thirdparty%2Fkernel%2Fstable.git perf/x86/intel/rapl: Fix pmus free during cleanup commit 275ae411e56f8f900fa364da29c4706f9af4e1f3 upstream. On rapl cleanup path, kfree() is given by mistake the address of the pointer of the structure to free (rapl_pmus->pmus + i). Pass the pointer instead (rapl_pmus->pmus[i]). Fixes: 9de8d686955b "perf/x86/intel/rapl: Convert it to a per package facility" Signed-off-by: Vincent Stehlé Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1464101629-14905-1-git-send-email-vincent.stehle@intel.com Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c index 1705c9d75e447..78ee9ebe38dd6 100644 --- a/arch/x86/events/intel/rapl.c +++ b/arch/x86/events/intel/rapl.c @@ -665,7 +665,7 @@ static void __init cleanup_rapl_pmus(void) int i; for (i = 0; i < rapl_pmus->maxpkg; i++) - kfree(rapl_pmus->pmus + i); + kfree(rapl_pmus->pmus[i]); kfree(rapl_pmus); }