[PATCH] tools/perf:Remove unnecessary assignment

Zhu Jun posted 1 patch 1 year, 5 months ago
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] tools/perf:Remove unnecessary assignment
Posted by Zhu Jun 1 year, 5 months ago
In the function cs_etm_decoder__init_def_logger_printing(),
the correct logic should be to return within the function
when ret is not equal to 0.

Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
 tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
index e917985bbbe6..dc80576180d5 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
@@ -238,6 +238,7 @@ cs_etm_decoder__init_def_logger_printing(struct cs_etm_decoder_params *d_params,
 					      cs_etm_decoder__print_str_cb);
 	if (ret != 0)
 		ret = -1;
+		return -1;
 
 	return 0;
 }
-- 
2.17.1