]> git.karo-electronics.de Git - karo-tx-linux.git/commit
arm64: atomic64_dec_if_positive: fix incorrect branch condition
authorWill Deacon <will.deacon@arm.com>
Fri, 29 May 2015 13:44:06 +0000 (14:44 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 27 Jul 2015 14:28:54 +0000 (15:28 +0100)
commitdb26217e6f54647b137a0fe1f2ab346de67d6f3e
tree5c839d3429de197f511161be339bcdacb786d471
parent6059a7b6e818023436a9058170a4fea1c670dc98
arm64: atomic64_dec_if_positive: fix incorrect branch condition

If we attempt to atomic64_dec_if_positive on INT_MIN, we will underflow
and incorrectly decide that the original parameter was positive.

This patches fixes the broken condition code so that we handle this
corner case correctly.

Reviewed-by: Steve Capper <steve.capper@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/atomic_ll_sc.h
arch/arm64/include/asm/atomic_lse.h