• Sean Christopherson's avatar
    KVM: x86: Use ERR_PTR_USR() to return -EFAULT as a __user pointer · 6e37ec88
    Sean Christopherson authored
    Use ERR_PTR_USR() when returning -EFAULT from kvm_get_attr_addr(), sparse
    complains about implicitly casting the kernel pointer from ERR_PTR() into
    a __user pointer.
    
    >> arch/x86/kvm/x86.c:4342:31: sparse: sparse: incorrect type in return expression
       (different address spaces) @@     expected void [noderef] __user * @@     got void * @@
       arch/x86/kvm/x86.c:4342:31: sparse:     expected void [noderef] __user *
       arch/x86/kvm/x86.c:4342:31: sparse:     got void *
    >> arch/x86/kvm/x86.c:4342:31: sparse: sparse: incorrect type in return expression
       (different address spaces) @@     expected void [noderef] __user * @@     got void * @@
       arch/x86/kvm/x86.c:4342:31: sparse:     expected void [noderef] __user *
       arch/x86/kvm/x86.c:4342:31: sparse:     got void *
    
    No functional change intended.
    
    Fixes: 56f289a8 ("KVM: x86: Add a helper to retrieve userspace address from kvm_device_attr")
    Reported-by: default avatarkernel test robot <lkp@intel.com>
    Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Message-Id: <20220202005157.2545816-1-seanjc@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    6e37ec88
x86.c 337 KB