[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 08/11] vfio/pci: Allocate and initialize HostIOMMUDevice a
From: |
Eric Auger |
Subject: |
Re: [PATCH v1 08/11] vfio/pci: Allocate and initialize HostIOMMUDevice after attachment |
Date: |
Mon, 18 Mar 2024 15:27:54 +0100 |
User-agent: |
Mozilla Thunderbird |
On 2/28/24 04:58, Zhenzhong Duan wrote:
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
> hw/vfio/pci.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 4fa387f043..6cc7de5d10 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -3006,6 +3006,9 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
> goto error;
> }
>
> + /* Allocate and initialize HostIOMMUDevice after attachment succeed */
after successful attachment?
> + host_iommu_device_create(vbasedev);
> +
you shall free on error: as well
Eric
> vfio_populate_device(vdev, &err);
> if (err) {
> error_propagate(errp, err);
> @@ -3244,6 +3247,7 @@ static void vfio_instance_finalize(Object *obj)
>
> vfio_display_finalize(vdev);
> vfio_bars_finalize(vdev);
> + g_free(vdev->vbasedev.base_hdev);
> g_free(vdev->emulated_config_bits);
> g_free(vdev->rom);
> /*
- Re: [PATCH v1 08/11] vfio/pci: Allocate and initialize HostIOMMUDevice after attachment,
Eric Auger <=