Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>

authored by

Markus Elfring and committed by
Arnaldo Carvalho de Melo
4cc97614 060664f3

+1 -2
+1 -2
tools/perf/util/header.c
··· 1063 1063 free(buf); 1064 1064 return events; 1065 1065 error: 1066 - if (events) 1067 - free_event_desc(events); 1066 + free_event_desc(events); 1068 1067 events = NULL; 1069 1068 goto out; 1070 1069 }