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>] [day] [month] [year] [list]
Message-Id: <20220918151550.210045-1-xu.panda@zte.com.cn>
Date:   Sun, 18 Sep 2022 15:15:51 +0000
From:   cgel.zte@...il.com
To:     richard.henderson@...aro.org
Cc:     ink@...assic.park.msu.ru, mattst88@...il.com,
        akpm@...ux-foundation.org, zhengqi.arch@...edance.com,
        ebiederm@...ssion.com, hannes@...xchg.org, catalin.marinas@....com,
        peterx@...hat.com, linux-alpha@...r.kernel.org,
        linux-kernel@...r.kernel.org, Xu Panda <xu.panda@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH linu-next] mm/fault: fix comparing pointer to 0

From: Xu Panda <xu.panda@....com.cn>

Do not use assignment in if condition,
and using "!P" instead of comparing pointer to 0.

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Xu Panda <xu.panda@....com.cn>
---
 arch/alpha/mm/fault.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index ef427a6bdd1a..09d0d069059b 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -194,7 +194,8 @@ do_page_fault(unsigned long address, unsigned long mmcsr,

  no_context:
        /* Are we prepared to handle this fault as an exception?  */
-       if ((fixup = search_exception_tables(regs->pc)) != 0) {
+       fixup = search_exception_tables(regs->pc);
+       if (!fixup) {
                unsigned long newpc;
                newpc = fixup_exception(dpf_reg, fixup, regs->pc);
                regs->pc = newpc;
-- 
2.15.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ