mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 17:59:32 +00:00
perf values: Fix allocation check
Bailing out in case the allocation failed, not the other way round. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20170824162737.7813-8-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
64eed1deb6
commit
f4ef3b7c18
1 changed files with 1 additions and 1 deletions
|
@ -131,7 +131,7 @@ static int perf_read_values__enlarge_counters(struct perf_read_values *values)
|
|||
for (i = 0; i < values->threads; i++) {
|
||||
u64 *value = realloc(values->value[i], counters_max * sizeof(**values->value));
|
||||
|
||||
if (value) {
|
||||
if (!value) {
|
||||
pr_debug("failed to enlarge read_values ->values array");
|
||||
goto out_free_name;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue