[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 8/9] vfio/display: Fix potential memleak of edid info
From: |
Cédric Le Goater |
Subject: |
[PULL 8/9] vfio/display: Fix potential memleak of edid info |
Date: |
Tue, 9 Jul 2024 13:50:16 +0200 |
From: Zhenzhong Duan <zhenzhong.duan@intel.com>
EDID related device region info is leaked in vfio_display_edid_init()
error path and VFIODisplay destroying path.
Fixes: 08479114b0de ("vfio/display: add edid support.")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/vfio/display.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/vfio/display.c b/hw/vfio/display.c
index
661e921616f4b85613d5f6053c30348a4ee6cbd2..9c57fd388886100bf9eae061def39688d33a8695
100644
--- a/hw/vfio/display.c
+++ b/hw/vfio/display.c
@@ -171,7 +171,9 @@ static void vfio_display_edid_init(VFIOPCIDevice *vdev)
err:
trace_vfio_display_edid_write_error();
+ g_free(dpy->edid_info);
g_free(dpy->edid_regs);
+ dpy->edid_info = NULL;
dpy->edid_regs = NULL;
return;
}
@@ -182,6 +184,7 @@ static void vfio_display_edid_exit(VFIODisplay *dpy)
return;
}
+ g_free(dpy->edid_info);
g_free(dpy->edid_regs);
g_free(dpy->edid_blob);
timer_free(dpy->edid_link_timer);
--
2.45.2
- [PULL 0/9] vfio queue, Cédric Le Goater, 2024/07/09
- [PULL 2/9] vfio-container-base: Introduce vfio_container_get_iova_ranges() helper, Cédric Le Goater, 2024/07/09
- [PULL 1/9] virtio-iommu: Fix error handling in virtio_iommu_set_host_iova_ranges(), Cédric Le Goater, 2024/07/09
- [PULL 6/9] memory: remove IOMMU MR iommu_set_page_size_mask() callback, Cédric Le Goater, 2024/07/09
- [PULL 5/9] virtio-iommu : Retrieve page size mask on virtio_iommu_set_iommu_device(), Cédric Le Goater, 2024/07/09
- [PULL 3/9] HostIOMMUDevice : remove Error handle from get_iova_ranges callback, Cédric Le Goater, 2024/07/09
- [PULL 4/9] HostIOMMUDevice: Introduce get_page_size_mask() callback, Cédric Le Goater, 2024/07/09
- [PULL 7/9] virtio-iommu: Revert transient enablement of IOMMU MR in bypass mode, Cédric Le Goater, 2024/07/09
- [PULL 8/9] vfio/display: Fix potential memleak of edid info,
Cédric Le Goater <=
- [PULL 9/9] vfio/display: Fix vfio_display_edid_init() error path, Cédric Le Goater, 2024/07/09
- Re: [PULL 0/9] vfio queue, Richard Henderson, 2024/07/09