From c348915585af12a7fc6453524d9835830dba574b Mon Sep 17 00:00:00 2001 From: Dominik Dingel Date: Thu, 18 Jun 2015 13:17:11 +0200 Subject: 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 --- arch/s390/kvm/kvm-s390.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/s390') 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); -- cgit v1.2.3