+6
-2
arch/s390/kvm/pv.c
+6
-2
arch/s390/kvm/pv.c
···
411
411
u16 _rc, _rrc;
412
412
int cc = 0;
413
413
414
-
/* Make sure the counter does not reach 0 before calling s390_uv_destroy_range */
415
-
atomic_inc(&kvm->mm->context.protected_count);
414
+
/*
415
+
* Nothing to do if the counter was already 0. Otherwise make sure
416
+
* the counter does not reach 0 before calling s390_uv_destroy_range.
417
+
*/
418
+
if (!atomic_inc_not_zero(&kvm->mm->context.protected_count))
419
+
return 0;
416
420
417
421
*rc = 1;
418
422
/* If the current VM is protected, destroy it */