diff options
| author | Claudio Imbrenda <imbrenda@linux.ibm.com> | 2026-04-02 17:01:35 +0200 |
|---|---|---|
| committer | Claudio Imbrenda <imbrenda@linux.ibm.com> | 2026-04-07 17:20:42 +0200 |
| commit | 9b8e8aad5896d66005d29920cb1643076a20b172 (patch) | |
| tree | 22a60eb71b8d41095c7bd83e3e6a07e0ffe946d0 | |
| parent | 857e92662c07543887dafdb14b127519f4c0ac93 (diff) | |
| download | linux-next-9b8e8aad5896d66005d29920cb1643076a20b172.tar.gz linux-next-9b8e8aad5896d66005d29920cb1643076a20b172.zip | |
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>
| -rw-r--r-- | arch/s390/kvm/kvm-s390.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 156878c95e06..63bc496d0c37 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -5642,7 +5642,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, struct kvm_memory_slot *new, enum kvm_mr_change change) { - if (kvm_is_ucontrol(kvm) && new->id < KVM_USER_MEM_SLOTS) + if (kvm_is_ucontrol(kvm) && new && new->id < KVM_USER_MEM_SLOTS) return -EINVAL; /* When we are protected, we should not change the memory slots */ |
