]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: uaccess: fix type of 0 variable on error in get_user()
authorBen Dooks <ben-linux@fluff.org>
Thu, 29 Dec 2022 17:05:45 +0000 (17:05 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:59 +0000 (11:41 +0100)
commit8f9e23db4afb6e14334ed443ec722f32b19a7d45
treee06ebaab9f510b8c3263b84f5ab512f8c41b7d02
parentef242c51c53267f880db0746a689e25b0bc2adf1
riscv: uaccess: fix type of 0 variable on error in get_user()

commit b9b916aee6715cd7f3318af6dc360c4729417b94 upstream.

If the get_user(x, ptr) has x as a pointer, then the setting
of (x) = 0 is going to produce the following sparse warning,
so fix this by forcing the type of 'x' when access_ok() fails.

fs/aio.c:2073:21: warning: Using plain integer as NULL pointer

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/20221229170545.718264-1-ben-linux@fluff.org
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/riscv/include/asm/uaccess.h