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-next>] [day] [month] [year] [list]
Message-ID: <20220727031100.112919-1-xuqiang36@huawei.com>
Date:   Wed, 27 Jul 2022 03:10:58 +0000
From:   Xu Qiang <xuqiang36@...wei.com>
To:     <linux@...linux.org.uk>, <robh@...nel.org>,
        <rmk+kernel@...linux.org.uk>, <kirill.shtuemov@...ux.intel.com>,
        <akpm@...ux-foundation.org>, <ardb@...nel.org>, <rppt@...nel.org>,
        <austindh.kim@...il.com>
CC:     <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>, <weiyongjun1@...wei.com>,
        <guohanjun@...wei.com>, <xuqiang36@...wei.com>
Subject: [PATCH -next 1/3] ARM: 9011/1: remove atags_vaddr variable double check

setup_machine_fdt() can handle NULL atags_vaddr as its argument,
and return NULL mdesc when atags_vaddr is NULL. So remove NULL
check before setup_machine_fdt operation.

Signed-off-by: Xu Qiang <xuqiang36@...wei.com>
---
 arch/arm/kernel/setup.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 1e8a50a97edf..07039c98be15 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1101,13 +1101,10 @@ void __init setup_arch(char **cmdline_p)
 		atags_vaddr = FDT_VIRT_BASE(__atags_pointer);
 
 	setup_processor();
-	if (atags_vaddr) {
-		mdesc = setup_machine_fdt(atags_vaddr);
-		if (mdesc)
-			memblock_reserve(__atags_pointer,
-					 fdt_totalsize(atags_vaddr));
-	}
-	if (!mdesc)
+	mdesc = setup_machine_fdt(atags_vaddr);
+	if (mdesc)
+		memblock_reserve(__atags_pointer, fdt_totalsize(atags_vaddr));
+	else
 		mdesc = setup_machine_tags(atags_vaddr, __machine_arch_type);
 	if (!mdesc) {
 		early_print("\nError: invalid dtb and unrecognized/unsupported machine ID\n");
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ