Skip to content

Commit 5a56f7c

Browse files
hcahcagregkh
authored andcommitted
s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple()
commit e3f360d upstream. Make sure that *ptr__ within arch_this_cpu_to_op_simple() is only dereferenced once by using READ_ONCE(). Otherwise the compiler could generate incorrect code. Cc: <[email protected]> Reviewed-by: Alexander Gordeev <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 58cee3a commit 5a56f7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/include/asm/percpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
pcp_op_T__ *ptr__; \
3232
preempt_disable_notrace(); \
3333
ptr__ = raw_cpu_ptr(&(pcp)); \
34-
prev__ = *ptr__; \
34+
prev__ = READ_ONCE(*ptr__); \
3535
do { \
3636
old__ = prev__; \
3737
new__ = old__ op (val); \

0 commit comments

Comments
 (0)