[PATCH] perf util: free cpu_map in perf_session__cpu_bitmap
From: Stanislav Fomichev
Date: Mon Dec 02 2013 - 09:36:47 EST
Free previously allocated map.
Signed-off-by: Stanislav Fomichev <stfomichev@xxxxxxxxxxxxxx>
---
tools/perf/util/session.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 4ce146bae552..ee717ee9ca3a 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1606,6 +1606,7 @@ int perf_session__cpu_bitmap(struct perf_session *session,
int cpu = map->map[i];
if (cpu >= MAX_NR_CPUS) {
+ cpu_map__delete(map);
pr_err("Requested CPU %d too large. "
"Consider raising MAX_NR_CPUS\n", cpu);
return -1;
@@ -1613,6 +1614,7 @@ int perf_session__cpu_bitmap(struct perf_session *session,
set_bit(cpu, cpu_bitmap);
}
+ cpu_map__delete(map);
return 0;
}
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/