Skip to content

Commit acb59a4

Browse files
GoodLuck612Alex Williamson
authored andcommitted
vfio/pds: replace bitmap_free with vfree
host_seq_bmp is allocated with vzalloc but is currently freed with bitmap_free, which uses kfree internally. This mismach prevents the resource from being released properly and may result in memory leaks or other issues. Fix this by freeing host_seq_bmp with vfree to match the vzalloc allocation. Fixes: f232836 ("vfio/pds: Add support for dirty page tracking") Signed-off-by: Zilin Guan <zilin@seu.edu.cn> Reviewed-by: Brett Creeley <brett.creeley@amd.com> Link: https://lore.kernel.org/r/20250913153154.1028835-1-zilin@seu.edu.cn Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
1 parent 16df67f commit acb59a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/vfio/pci/pds/dirty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static int pds_vfio_dirty_alloc_bitmaps(struct pds_vfio_region *region,
8282

8383
host_ack_bmp = vzalloc(bytes);
8484
if (!host_ack_bmp) {
85-
bitmap_free(host_seq_bmp);
85+
vfree(host_seq_bmp);
8686
return -ENOMEM;
8787
}
8888

0 commit comments

Comments
 (0)