Skip to content

Commit d0f2eb4

Browse files
author
Claudio Imbrenda
committed
KVM: s390: vsie: Fix memory leak when unshadowing
When performing a partial unshadowing, the rmap was being leaked. Add the missing kfree(). Fixes: a2c17f9 ("KVM: s390: New gmap code") Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
1 parent 6779b50 commit d0f2eb4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

arch/s390/kvm/gmap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,8 +1143,10 @@ void _gmap_handle_vsie_unshadow_event(struct gmap *parent, gfn_t gfn)
11431143
}
11441144
scoped_guard(spinlock, &sg->host_to_rmap_lock)
11451145
head = radix_tree_delete(&sg->host_to_rmap, gfn);
1146-
gmap_for_each_rmap_safe(rmap, rnext, head)
1146+
gmap_for_each_rmap_safe(rmap, rnext, head) {
11471147
gmap_unshadow_level(sg, rmap->r_gfn, rmap->level);
1148+
kfree(rmap);
1149+
}
11481150
}
11491151
}
11501152

0 commit comments

Comments
 (0)