Patch "asm-generic: Fix 32 bit __generic_cmpxchg_local" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    asm-generic: Fix 32 bit __generic_cmpxchg_local

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asm-generic-fix-32-bit-__generic_cmpxchg_local.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c0e437618e19e30830e7e4a33e5b6832c480b842
Author: David McKay <david.mckay@xxxxxxxxxxx>
Date:   Thu Jan 4 09:40:10 2024 +0000

    asm-generic: Fix 32 bit __generic_cmpxchg_local
    
    [ Upstream commit d93cca2f3109f88c94a32d3322ec8b2854a9c339 ]
    
    Commit 656e9007ef58 ("asm-generic: avoid __generic_cmpxchg_local
    warnings") introduced a typo that means the code is incorrect for 32 bit
    values. It will work fine for postive numbers, but will fail for
    negative numbers on a system where longs are 64 bit.
    
    Fixes: 656e9007ef58 ("asm-generic: avoid __generic_cmpxchg_local warnings")
    Signed-off-by: David McKay <david.mckay@xxxxxxxxxxx>
    Signed-off-by: Stuart Menefy <stuart.menefy@xxxxxxxxxxx>
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h
index 3df9f59a544e..f27d66fdc00a 100644
--- a/include/asm-generic/cmpxchg-local.h
+++ b/include/asm-generic/cmpxchg-local.h
@@ -34,7 +34,7 @@ static inline unsigned long __generic_cmpxchg_local(volatile void *ptr,
 			*(u16 *)ptr = (new & 0xffffu);
 		break;
 	case 4: prev = *(u32 *)ptr;
-		if (prev == (old & 0xffffffffffu))
+		if (prev == (old & 0xffffffffu))
 			*(u32 *)ptr = (new & 0xffffffffu);
 		break;
 	case 8: prev = *(u64 *)ptr;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux