Skip to content

Commit 4cc9761

Browse files
elfringacmel
authored andcommitted
perf header: Delete an unnecessary check before the calling free_event_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 <[email protected]> Cc: Julia Lawall <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 060664f commit 4cc9761

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/perf/util/header.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,7 @@ read_event_desc(struct perf_header *ph, int fd)
10631063
free(buf);
10641064
return events;
10651065
error:
1066-
if (events)
1067-
free_event_desc(events);
1066+
free_event_desc(events);
10681067
events = NULL;
10691068
goto out;
10701069
}

0 commit comments

Comments
 (0)