Commit 0ec456b8 authored by Claudio Imbrenda's avatar Claudio Imbrenda
Browse files

KVM: s390: vsie: Fix refcount overflow for shadow gmaps



In most cases gmap_put() was not called when it should have.

Add the missing gmap_put() in vsie_run().

Fixes: e38c884d ("KVM: s390: Switch to new gmap")
Reviewed-by: default avatarSteffen Eiden <seiden@linux.ibm.com>
Reviewed-by: default avatarJanosch Frank <frankja@linux.ibm.com>
Signed-off-by: default avatarClaudio Imbrenda <imbrenda@linux.ibm.com>
parent fd7bc612
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1328,7 +1328,7 @@ static void unregister_shadow_scb(struct kvm_vcpu *vcpu)
static int vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
{
	struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s;
	struct gmap *sg;
	struct gmap *sg = NULL;
	int rc = 0;

	while (1) {
@@ -1368,6 +1368,8 @@ static int vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
			sg = gmap_put(sg);
		cond_resched();
	}
	if (sg)
		sg = gmap_put(sg);

	if (rc == -EFAULT) {
		/*