[PATCH] perf version: Fix segfault

From: Ravi Bangoria
Date: Mon Jun 10 2019 - 23:06:36 EST


'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@xxxxxxxxxxxxx>
Reviewed-by: Kamalesh babulal <kamalesh@xxxxxxxxxxxxxxxxxx>
Tested-by: Mamatha Inamdar <mamatha4@xxxxxxxxxxxxxxxxxx>
---
tools/perf/builtin-version.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c
index f470144d1a70..bf114ca9ca87 100644
--- a/tools/perf/builtin-version.c
+++ b/tools/perf/builtin-version.c
@@ -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[] = {
--
2.20.1