Skip to content

Commit

Permalink
perf: Remove superfluous allocation error check
Browse files Browse the repository at this point in the history
If the get_callchain_buffers fails to allocate the buffer it will
decrease the nr_callchain_events right away.

There's no point of checking the allocation error for
nr_callchain_events > 1. Removing that check.

Signed-off-by: Jiri Olsa <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
olsajiri authored and acmel committed Apr 17, 2018
1 parent 5af44ca commit bfb3d7b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions kernel/events/callchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,8 @@ int get_callchain_buffers(int event_max_stack)
goto exit;
}

if (count > 1) {
/* If the allocation failed, give up */
if (!callchain_cpus_entries)
err = -ENOMEM;
goto exit;
}

err = alloc_callchain_buffers();
if (count == 1)
err = alloc_callchain_buffers();
exit:
if (err)
atomic_dec(&nr_callchain_events);
Expand Down

0 comments on commit bfb3d7b

Please sign in to comment.