projects/linux·commit 21b9e722

m68k: cmpxchg: Fix return value for default case in __arch_xchg()

21b9e722 · Thorsten Blum <[email protected]> · 2024-07-02 05:41:17 +02:00

The return value of __invalid_xchg_size() is assigned to tmp instead of
the return variable x. Assign it to x instead.

Fixes: 2501cf768e4009a0 ("m68k: Fix xchg/cmpxchg to fail to link if given an inappropriate pointer")
Signed-off-by: Thorsten Blum <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Geert Uytterhoeven <[email protected]>
Commit
21b9e722ad28c19c2bc83f18f540b3dbd89bf762
Parents
75d3891c

Changes

1 files changed · +1 −1

FileStatusAddDelContent
arch/m68k/include/asm/cmpxchg.hmodified+1−1View file

arch/m68k/include/asm/cmpxchg.h

View file
diff --git a/arch/m68k/include/asm/cmpxchg.h b/arch/m68k/include/asm/cmpxchg.h
index d7f3de9..4ba14f3 100644
--- a/arch/m68k/include/asm/cmpxchg.h
+++ b/arch/m68k/include/asm/cmpxchg.h
@@ -32,7 +32,7 @@ static inline unsigned long __arch_xchg(unsigned long x, volatile void * ptr, in
x = tmp;
break;
default:
- tmp = __invalid_xchg_size(x, ptr, size);
+ x = __invalid_xchg_size(x, ptr, size);
break;
}