kvm: x86: use NULL instead of using plain integer as pointer
authorMuhammad Usama Anjum <musamaanjum@gmail.com>
Fri, 5 Mar 2021 18:08:16 +0000 (23:08 +0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 6 Mar 2021 09:18:39 +0000 (04:18 -0500)
Sparse warnings removed:
warning: Using plain integer as NULL pointer

Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
Message-Id: <20210305180816.GA488770@LEGION>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c

index 868213ca4f98444a0d940836448d305a1f78835a..46b0e52671bb620a968f29cf9bedced623c7f164 100644 (file)
@@ -10600,7 +10600,7 @@ void __user * __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa,
                        return (void __user *)hva;
        } else {
                if (!slot || !slot->npages)
-                       return 0;
+                       return NULL;
 
                old_npages = slot->npages;
                hva = slot->userspace_addr;