Skip to contentSkip to conversation

kvm: x86: use NULL instead of using plain integer as pointer

PATCH New Muhammad Usama Anjum 1 participant 1 message Mar 5, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: x86: use NULL instead of using plain integer as pointer

Sparse warnings removed:
warning: Using plain integer as NULL pointer

---
 arch/x86/kvm/x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/x86.c +1 -1
index 884e5b3838c7..3e11065038e5 100644
@@ -10570,7 +10570,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;
Signature · 1 line
2.25.1