summaryrefslogtreecommitdiff
path: root/tools/perf/tests/kallsyms-split.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/kallsyms-split.c')
-rw-r--r--tools/perf/tests/kallsyms-split.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/tests/kallsyms-split.c b/tools/perf/tests/kallsyms-split.c
index 117ed3b70f63..244daa01bd5d 100644
--- a/tools/perf/tests/kallsyms-split.c
+++ b/tools/perf/tests/kallsyms-split.c
@@ -97,7 +97,7 @@ err:
static int test__kallsyms_split(struct test_suite *test __maybe_unused,
int subtest __maybe_unused)
{
- struct machine m;
+ struct machine m = { 0 };
struct map *map = NULL;
int ret = TEST_FAIL;
@@ -113,7 +113,10 @@ static int test__kallsyms_split(struct test_suite *test __maybe_unused,
signal(SIGTERM, remove_proc_dir);
pr_debug("create kernel maps from the fake root directory\n");
- machine__init(&m, root_dir, HOST_KERNEL_ID);
+ if (machine__init(&m, root_dir, HOST_KERNEL_ID)) {
+ pr_debug("FAIL: failed to init machine\n");
+ goto out;
+ }
if (machine__create_kernel_maps(&m) < 0) {
pr_debug("FAIL: failed to create kernel maps\n");
goto out;