lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 10 Aug 2020 12:06:14 +0800
From:   Youling Tang <tangyouling@...ngson.cn>
To:     Josh Poimboeuf <jpoimboe@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH] tools/objtool: Fix unnecessary jumps

There is no need to jump to the "out" tag when "ret < 0", just return
directly to "ret".

Signed-off-by: Youling Tang <tangyouling@...ngson.cn>
---
 tools/objtool/check.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index e034a8f..94b166d 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2799,7 +2799,7 @@ int check(const char *_objname, bool orc)
 
 	ret = decode_sections(&file);
 	if (ret < 0)
-		goto out;
+		return ret;
 	warnings += ret;
 
 	if (list_empty(&file.insn_list))
@@ -2808,7 +2808,7 @@ int check(const char *_objname, bool orc)
 	if (vmlinux && !validate_dup) {
 		ret = validate_vmlinux_functions(&file);
 		if (ret < 0)
-			goto out;
+			return ret;
 
 		warnings += ret;
 		goto out;
@@ -2823,35 +2823,35 @@ int check(const char *_objname, bool orc)
 
 	ret = validate_functions(&file);
 	if (ret < 0)
-		goto out;
+		return ret;
 	warnings += ret;
 
 	ret = validate_unwind_hints(&file, NULL);
 	if (ret < 0)
-		goto out;
+		return ret;
 	warnings += ret;
 
 	if (!warnings) {
 		ret = validate_reachable_instructions(&file);
 		if (ret < 0)
-			goto out;
+			return ret;
 		warnings += ret;
 	}
 
 	if (orc) {
 		ret = create_orc(&file);
 		if (ret < 0)
-			goto out;
+			return ret;
 
 		ret = create_orc_sections(&file);
 		if (ret < 0)
-			goto out;
+			return ret;
 	}
 
 	if (file.elf->changed) {
 		ret = elf_write(file.elf);
 		if (ret < 0)
-			goto out;
+			return ret;
 	}
 
 out:
-- 
2.1.0

Powered by blists - more mailing lists