]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
m68k: cmpxchg: Fix return value for default case in __arch_xchg()
authorThorsten Blum <thorsten.blum@toblux.com>
Tue, 2 Jul 2024 03:41:17 +0000 (05:41 +0200)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 9 Jul 2024 07:19:31 +0000 (09:19 +0200)
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 <thorsten.blum@toblux.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/20240702034116.140234-2-thorsten.blum@toblux.com
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/include/asm/cmpxchg.h

index d7f3de9c5d6f793b134a4d687aba2c2a5de85823..4ba14f3535fcbe2fc108b2af41eb41a34c18a821 100644 (file)
@@ -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;
        }