aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <[email protected]>2020-05-22 15:23:21 +0100
committerCatalin Marinas <[email protected]>2020-05-22 16:59:49 +0100
commit8cfb347ad0cffdbfc69c82506fb3be9429563211 (patch)
tree68572474dac4176aab8a86a63b11a03a8f57e005
parent1cf6022bd9161081215028203919c33fcfa6debb (diff)
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 <[email protected]> Reported-by: kbuild test robot <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
-rw-r--r--arch/arm64/include/asm/uaccess.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
index 32fc8061aa76..bc5c7b091152 100644
--- a/arch/arm64/include/asm/uaccess.h
+++ b/arch/arm64/include/asm/uaccess.h
@@ -304,7 +304,7 @@ do { \
__p = uaccess_mask_ptr(__p); \
__raw_get_user((x), __p, (err)); \
} else { \
- (x) = 0; (err) = -EFAULT; \
+ (x) = (__force __typeof__(x))0; (err) = -EFAULT; \
} \
} while (0)