Skip to content

Commit 020667d

Browse files
clementlegerpalmer-dabbelt
authored andcommitted
riscv: process: use unsigned int instead of unsigned long for put_user()
The specification of prctl() for GET_UNALIGN_CTL states that the value is returned in an unsigned int * address passed as an unsigned long. Change the type to match that and avoid an unaligned access as well. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/r/20250602193918.868962-3-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
1 parent a434854 commit 020667d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int get_unalign_ctl(struct task_struct *tsk, unsigned long adr)
5757
if (!unaligned_ctl_available())
5858
return -EINVAL;
5959

60-
return put_user(tsk->thread.align_ctl, (unsigned long __user *)adr);
60+
return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr);
6161
}
6262

6363
void __show_regs(struct pt_regs *regs)

0 commit comments

Comments
 (0)