Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: e3ed75bb537a8 ("perf buildid-cache: Move session...")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zhihao Cheng <[email protected]>
---
tools/perf/builtin-buildid-cache.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-buildid-cache.c
b/tools/perf/builtin-buildid-cache.c
index ecd0d3cb6f5c..f703ba11e12c 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -448,7 +448,8 @@ int cmd_buildid_cache(int argc, const char **argv)
return PTR_ERR(session);
}
- if (symbol__init(session ? &session->header.env : NULL) < 0)
+ ret = symbol__init(session ? &session->header.env : NULL);
+ if (ret < 0)
goto out;
setup_pager();
--
2.25.4