diff options
author | Oleksii Moisieiev | 2022-12-20 14:50:13 +0000 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-02-01 08:34:30 +0100 |
commit | b91ec58ffb8a5bcc77bd332467f66b0dc5773c59 (patch) | |
tree | 52ca2acd56fd1694ce7109a7ef7a8d4d603da0fc | |
parent | 25714807b1fdcf1d7987af8e619e0e5f6893a890 (diff) |
xen/pvcalls: free active map buffer on pvcalls_front_free_map
[ Upstream commit f57034cedeb6e00256313a2a6ee67f974d709b0b ]
Data buffer for active map is allocated in alloc_active_ring and freed
in free_active_ring function, which is used only for the error
cleanup. pvcalls_front_release is calling pvcalls_front_free_map which
ends foreign access for this buffer, but doesn't free allocated pages.
Call free_active_ring to clean all allocated resources.
Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/6a762ee32dd655cbb09a4aa0e2307e8919761311.1671531297.git.oleksii_moisieiev@epam.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/xen/pvcalls-front.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c index 1826e8e67125..9b569278788a 100644 --- a/drivers/xen/pvcalls-front.c +++ b/drivers/xen/pvcalls-front.c @@ -225,6 +225,8 @@ again: return IRQ_HANDLED; } +static void free_active_ring(struct sock_mapping *map); + static void pvcalls_front_free_map(struct pvcalls_bedata *bedata, struct sock_mapping *map) { @@ -240,7 +242,7 @@ static void pvcalls_front_free_map(struct pvcalls_bedata *bedata, for (i = 0; i < (1 << PVCALLS_RING_ORDER); i++) gnttab_end_foreign_access(map->active.ring->ref[i], NULL); gnttab_end_foreign_access(map->active.ref, NULL); - free_page((unsigned long)map->active.ring); + free_active_ring(map); kfree(map); } |