perf version: Fix segfault due to missing OPT_END()
authorRavi Bangoria <ravi.bangoria@linux.ibm.com>
Tue, 11 Jun 2019 03:01:09 +0000 (08:31 +0530)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 15 Jul 2019 10:59:05 +0000 (07:59 -0300)
'perf version' on powerpc segfaults when used with non-supported
option:
  # perf version -a
  Segmentation fault (core dumped)

Fix this.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Tested-by: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20190611030109.20228-1-ravi.bangoria@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-version.c

index f470144d1a7043ecf9fbcc3467d15c6df148b3d1..bf114ca9ca870ba27bdc8a29d88faecf42895015 100644 (file)
@@ -19,6 +19,7 @@ static struct version version;
 static struct option version_options[] = {
        OPT_BOOLEAN(0, "build-options", &version.build_options,
                    "display the build options"),
+       OPT_END(),
 };
 
 static const char * const version_usage[] = {