Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: s390: ucontrol: Fix memslot handling

Fix memslots handling for UCONTROL guests. Attempts to delete user
memslots will fail, as they should, without the risk of a NULL pointer
dereference.

Fixes: 413c98f24c63 ("KVM: s390: fake memslot for ucontrol VMs")
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

+1 -1
+1 -1
arch/s390/kvm/kvm-s390.c
··· 5642 5642 struct kvm_memory_slot *new, 5643 5643 enum kvm_mr_change change) 5644 5644 { 5645 - if (kvm_is_ucontrol(kvm) && new->id < KVM_USER_MEM_SLOTS) 5645 + if (kvm_is_ucontrol(kvm) && new && new->id < KVM_USER_MEM_SLOTS) 5646 5646 return -EINVAL; 5647 5647 5648 5648 /* When we are protected, we should not change the memory slots */