From: Dominik Dingel Date: Thu, 18 Jun 2015 11:17:11 +0000 (+0200) Subject: KVM: s390: only reset CMMA state if it was enabled before X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c348915585af12a7fc6453524d9835830dba574b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git KVM: s390: only reset CMMA state if it was enabled before There is no point in resetting the CMMA state if it was never enabled. Signed-off-by: Dominik Dingel Reviewed-by: David Hildenbrand Signed-off-by: Christian Borntraeger --- diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 641639b2fbd0..3772947ac194 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -344,6 +344,10 @@ static int kvm_s390_set_mem_control(struct kvm *kvm, struct kvm_device_attr *att mutex_unlock(&kvm->lock); break; case KVM_S390_VM_MEM_CLR_CMMA: + ret = -EINVAL; + if (!kvm->arch.use_cmma) + break; + mutex_lock(&kvm->lock); idx = srcu_read_lock(&kvm->srcu); s390_reset_cmma(kvm->arch.gmap->mm);