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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220127204115.384161-10-yazen.ghannam@amd.com>
Date:   Thu, 27 Jan 2022 20:41:00 +0000
From:   Yazen Ghannam <yazen.ghannam@....com>
To:     <linux-edac@...r.kernel.org>
CC:     <linux-kernel@...r.kernel.org>, <bp@...en8.de>,
        <mchehab@...nel.org>, <tony.luck@...el.com>, <james.morse@....com>,
        <rric@...nel.org>, <Smita.KoralahalliChannabasappa@....com>,
        Yazen Ghannam <yazen.ghannam@....com>
Subject: [PATCH v4 09/24] EDAC/amd64: Remove goto statements

...and just return error codes directly.

Signed-off-by: Yazen Ghannam <yazen.ghannam@....com>
---
Link:
https://lore.kernel.org/r/20211028175728.121452-14-yazen.ghannam@amd.com

v3->v4:
* No change.

v2->v3:
* Was patch 14 in v2.

v1->v2:
* Moved from arch/x86 to EDAC.

 drivers/edac/amd64_edac.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 139dca3a3ba4..d568ad886d35 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -1357,44 +1357,41 @@ static int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr
 
 	if (remove_dram_offset(&ctx)) {
 		pr_debug("Failed to remove DRAM offset");
-		goto out_err;
+		return -EINVAL;
 	}
 
 	if (get_dram_addr_map(&ctx)) {
 		pr_debug("Failed to get DRAM address map");
-		goto out_err;
+		return -EINVAL;
 	}
 
 	if (df_ops->get_intlv_mode(&ctx)) {
 		pr_debug("Failed to get interleave mode");
-		goto out_err;
+		return -EINVAL;
 	}
 
 	if (denormalize_addr(&ctx)) {
 		pr_debug("Failed to denormalize address");
-		goto out_err;
+		return -EINVAL;
 	}
 
 	if (add_base_and_hole(&ctx)) {
 		pr_debug("Failed to add DRAM base address and hole");
-		goto out_err;
+		return -EINVAL;
 	}
 
 	if (ctx.dehash_addr && ctx.dehash_addr(&ctx)) {
 		pr_debug("Failed to dehash address");
-		goto out_err;
+		return -EINVAL;
 	}
 
 	if (addr_over_limit(&ctx)) {
 		pr_debug("Calculated address is over limit");
-		goto out_err;
+		return -EINVAL;
 	}
 
 	*sys_addr = ctx.ret_addr;
 	return 0;
-
-out_err:
-	return -EINVAL;
 }
 
 static int get_channel_from_ecc_syndrome(struct mem_ctl_info *, u16);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ