Skip to content

Commit 0ec456b

Browse files
author
Claudio Imbrenda
committed
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: e38c884 ("KVM: s390: Switch to new gmap") Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
1 parent fd7bc61 commit 0ec456b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

arch/s390/kvm/vsie.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ static void unregister_shadow_scb(struct kvm_vcpu *vcpu)
13281328
static int vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
13291329
{
13301330
struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s;
1331-
struct gmap *sg;
1331+
struct gmap *sg = NULL;
13321332
int rc = 0;
13331333

13341334
while (1) {
@@ -1368,6 +1368,8 @@ static int vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
13681368
sg = gmap_put(sg);
13691369
cond_resched();
13701370
}
1371+
if (sg)
1372+
sg = gmap_put(sg);
13711373

13721374
if (rc == -EFAULT) {
13731375
/*

0 commit comments

Comments
 (0)