]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: Add get_user() type annotation on the !access_ok() path
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 22 May 2020 14:23:21 +0000 (15:23 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 22 May 2020 15:59:49 +0000 (16:59 +0100)
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>
arch/arm64/include/asm/uaccess.h

index 32fc8061aa76ffcca455ee85790058c2a6ada1ed..bc5c7b091152056fbcef59719bd4245799897c23 100644 (file)
@@ -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)