Skip to content

Commit 635e3f3

Browse files
changbindupalmer-dabbelt
authored andcommitted
riscv: uaccess: fix __put_kernel_nofault()
The copy_from_kernel_nofault() is broken on riscv because the 'dst' and 'src' are mistakenly reversed in __put_kernel_nofault() macro. copy_to_kernel_nofault: ... 0xffffffe0003159b8 <+30>: sd a4,0(a1) # a1 aka 'src' Fixes: d464118 ("riscv: implement __get_kernel_nofault and __put_user_nofault") Signed-off-by: Changbin Du <changbin.du@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Anup Patel <anup@brainfault.org> Tested-by: Anup Patel <anup@brainfault.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
1 parent bcacf5f commit 635e3f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/riscv/include/asm/uaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ do { \
476476
do { \
477477
long __kr_err; \
478478
\
479-
__put_user_nocheck(*((type *)(dst)), (type *)(src), __kr_err); \
479+
__put_user_nocheck(*((type *)(src)), (type *)(dst), __kr_err); \
480480
if (unlikely(__kr_err)) \
481481
goto err_label; \
482482
} while (0)

0 commit comments

Comments
 (0)