diff options
| author | Claudio Imbrenda <imbrenda@linux.ibm.com> | 2026-05-19 17:01:10 +0200 |
|---|---|---|
| committer | Claudio Imbrenda <imbrenda@linux.ibm.com> | 2026-05-22 11:25:10 +0200 |
| commit | d0f2eb4493d1c3c8fecb5eadb5c1382074873ef9 (patch) | |
| tree | 3582b08b264de7d287c704dec2625f47c74edf23 | |
| parent | 6779b50faa562e6cca1aa6a4649a4d764c6c7e28 (diff) | |
KVM: s390: vsie: Fix memory leak when unshadowing
When performing a partial unshadowing, the rmap was being leaked.
Add the missing kfree().
Fixes: a2c17f9270cc ("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>
| -rw-r--r-- | arch/s390/kvm/gmap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/kvm/gmap.c b/arch/s390/kvm/gmap.c index 3c26e35af0ef..fd1927761980 100644 --- a/arch/s390/kvm/gmap.c +++ b/arch/s390/kvm/gmap.c @@ -1143,8 +1143,10 @@ void _gmap_handle_vsie_unshadow_event(struct gmap *parent, gfn_t gfn) } scoped_guard(spinlock, &sg->host_to_rmap_lock) head = radix_tree_delete(&sg->host_to_rmap, gfn); - gmap_for_each_rmap_safe(rmap, rnext, head) + gmap_for_each_rmap_safe(rmap, rnext, head) { gmap_unshadow_level(sg, rmap->r_gfn, rmap->level); + kfree(rmap); + } } } |
