Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Commit

Permalink
perf header: Delete an unnecessary check before the calling free_even…
Browse files Browse the repository at this point in the history
…t_desc()

The free_event_desc() function tests whether its argument is NULL and
then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: kernel-janitors@vger.kernel.org
Link: http://lkml.kernel.org/r/558C2ABA.3000603@users.sourceforge.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
elfring authored and acmel committed Jun 25, 2015
1 parent 060664f commit 4cc9761
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/perf/util/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,7 @@ read_event_desc(struct perf_header *ph, int fd)
free(buf);
return events;
error:
if (events)
free_event_desc(events);
free_event_desc(events);
events = NULL;
goto out;
}
Expand Down

0 comments on commit 4cc9761

Please sign in to comment.