Re: [PATCH] vfio/pci: Fix null pointer deference from error API

2024-09-13 Thread Jim Shu
On Thu, Sep 12, 2024 at 5:56 PM Cédric Le Goater wrote: > > Hello Jim, > > On 9/12/24 08:36, Jim Shu wrote: > > Hi Cédric, > > > > Thank you very much for the quick response! > > > > I have checked the error API again. It seems to be my porting issue of > > set_iommu_device() callback. > > Are you

Re: [PATCH] vfio/pci: Fix null pointer deference from error API

2024-09-12 Thread Cédric Le Goater
Hello Jim, On 9/12/24 08:36, Jim Shu wrote: Hi Cédric, Thank you very much for the quick response! I have checked the error API again. It seems to be my porting issue of set_iommu_device() callback. Are you adding support for a new IOMMU ? I think "pci_device_set_iommu_device(..., *errp)"

Re: [PATCH] vfio/pci: Fix null pointer deference from error API

2024-09-11 Thread Jim Shu
Hi Cédric, Thank you very much for the quick response! I have checked the error API again. It seems to be my porting issue of set_iommu_device() callback. I think "pci_device_set_iommu_device(..., *errp)" should set 'errp' if this function returns false, right? Thanks, Jim On Thu, Sep 12, 2024

Re: [PATCH] vfio/pci: Fix null pointer deference from error API

2024-09-11 Thread Cédric Le Goater
Hello Jim, On 9/12/24 07:17, Jim Shu wrote: pci_dev_realize() use the local error variable, which requires `error_setg()` API to allocate the error object at first. Signed-off-by: Jim Shu --- hw/vfio/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/h

[PATCH] vfio/pci: Fix null pointer deference from error API

2024-09-11 Thread Jim Shu
pci_dev_realize() use the local error variable, which requires `error_setg()` API to allocate the error object at first. Signed-off-by: Jim Shu --- hw/vfio/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 0a99e55247..d994ad8bb9 100644