Skip to content

Commit f57034c

Browse files
oleksiimoisieievjgross1
authored andcommitted
xen/pvcalls: free active map buffer on pvcalls_front_free_map
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 <[email protected]> Reviewed-by: Stefano Stabellini <[email protected]> Link: https://lore.kernel.org/r/6a762ee32dd655cbb09a4aa0e2307e8919761311.1671531297.git.oleksii_moisieiev@epam.com Signed-off-by: Juergen Gross <[email protected]>
1 parent c0dccad commit f57034c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/xen/pvcalls-front.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ static irqreturn_t pvcalls_front_event_handler(int irq, void *dev_id)
225225
return IRQ_HANDLED;
226226
}
227227

228+
static void free_active_ring(struct sock_mapping *map);
229+
228230
static void pvcalls_front_free_map(struct pvcalls_bedata *bedata,
229231
struct sock_mapping *map)
230232
{
@@ -240,7 +242,7 @@ static void pvcalls_front_free_map(struct pvcalls_bedata *bedata,
240242
for (i = 0; i < (1 << PVCALLS_RING_ORDER); i++)
241243
gnttab_end_foreign_access(map->active.ring->ref[i], NULL);
242244
gnttab_end_foreign_access(map->active.ref, NULL);
243-
free_page((unsigned long)map->active.ring);
245+
free_active_ring(map);
244246

245247
kfree(map);
246248
}

0 commit comments

Comments
 (0)