Skip to content

Commit 8cfb347

Browse files
Al Viroctmarinas
authored andcommitted
arm64: Add get_user() type annotation on the !access_ok() path
Sparse reports "Using plain integer as NULL pointer" when the arm64 __get_user_error() assigns 0 to a pointer type. Use proper type annotation. Signed-of-by: Al Viro <viro@zeniv.linux.org.uk> Reported-by: kbuild test robot <lkp@intel.com> Link: http://lkml.kernel.org/r/20200522142321.GP23230@ZenIV.linux.org.uk Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 1cf6022 commit 8cfb347

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm64/include/asm/uaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ do { \
304304
__p = uaccess_mask_ptr(__p); \
305305
__raw_get_user((x), __p, (err)); \
306306
} else { \
307-
(x) = 0; (err) = -EFAULT; \
307+
(x) = (__force __typeof__(x))0; (err) = -EFAULT; \
308308
} \
309309
} while (0)
310310

0 commit comments

Comments
 (0)