Skip to contentSkip to conversation

perf/x86/intel/rapl: fix pmus free during cleanup

PATCH New Vincent Stehlé 1 participant 1 message May 24, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf/x86/intel/rapl: fix pmus free during cleanup

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]).

This was introduced by commit 9de8d686955b0e8e27847ed4edbbcd280f3fd8 ("perf/x86/intel/rapl: Convert it to a per package facility").

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/events/intel/rapl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/rapl.c +1 -1
index 99c4bab..e30eef4 100644
@@ -714,7 +714,7 @@ static void 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);
 }
 
Signature · 1 line
2.8.1