Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 614d73ed authored by Russell King's avatar Russell King Committed by Russell King
Browse files

[ARM SMP] Fix data corruption in test_* bitops



If we found that the bit was already in the desired state, we
would skip performing the operation, and write random data back.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 9e566d8b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -19,9 +19,9 @@
	mov	r3, r2, lsl r3		@ create mask
1:	ldrexb	r2, [r1]
	ands	r0, r2, r3		@ save old value of bit
	\instr	ip, r2, r3			@ toggle bit
	strexb	r2, ip, [r1]
	cmp	r2, #0
	\instr	r2, r2, r3			@ toggle bit
	strexb	ip, r2, [r1]
	cmp	ip, #0
	bne	1b
	cmp	r0, #0
	movne	r0, #1