Skip to contentSkip to conversation

alpha/mm: Fix comparing pointer

PATCH In review [email protected] 2 participants 2 messages Jun 14, 2023 1 message not in the archive Alpha port

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 alpha/mm: Fix comparing pointer

Fix the following coccicheck warning:

arch/alpha/mm/fault.c:200:52-53: WARNING comparing pointer to 0

---
 arch/alpha/mm/fault.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/alpha/mm/fault.c +2 -1
index 7b01ae4f3bc6..31db549ef0b5 100644
@@ -197,7 +197,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 != NULL) {
         unsigned long newpc;
         newpc = fixup_exception(dpf_reg, fixup, regs->pc);
         regs->pc = newpc;