[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/7] vfio/ccw: Fix the missed unrealize() call in error path
From: |
Cédric Le Goater |
Subject: |
[PATCH 6/7] vfio/ccw: Fix the missed unrealize() call in error path |
Date: |
Wed, 22 May 2024 19:01:06 +0200 |
From: Zhenzhong Duan <zhenzhong.duan@intel.com>
When get name failed, we should call unrealize() so that
vfio_ccw_realize() is self contained.
Fixes: 909a6254eda ("vfio/ccw: Make vfio cdev pre-openable by passing a file
handle")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
hw/vfio/ccw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index
a468fa2342b97e0ee36bd5fb8443025cc90a0453..36f2677a448c5e31523dcc3de7d973ec70e4a13c
100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -588,7 +588,7 @@ static void vfio_ccw_realize(DeviceState *dev, Error **errp)
}
if (!vfio_device_get_name(vbasedev, errp)) {
- return;
+ goto out_unrealize;
}
if (!vfio_attach_device(cdev->mdevid, vbasedev,
@@ -631,6 +631,7 @@ out_region_err:
vfio_detach_device(vbasedev);
out_attach_dev_err:
g_free(vbasedev->name);
+out_unrealize:
if (cdc->unrealize) {
cdc->unrealize(cdev);
}
--
2.45.1
- Re: [PATCH 2/7] s390x/css: Make CCWDeviceClass::realize return bool, (continued)
- [PATCH 4/7] s390x/css: Make S390CCWDeviceClass::realize return bool, Cédric Le Goater, 2024/05/22
- [PATCH 3/7] hw/s390x/ccw: Remove local Error variable from s390_ccw_realize(), Cédric Le Goater, 2024/05/22
- [PATCH 5/7] vfio/ccw: Use the 'Error **errp' argument of vfio_ccw_realize(), Cédric Le Goater, 2024/05/22
- [PATCH 6/7] vfio/ccw: Fix the missed unrealize() call in error path,
Cédric Le Goater <=
- [PATCH 7/7] vfio/{ap, ccw}: Use warn_report_err() for IRQ notifier registration errors, Cédric Le Goater, 2024/05/22
- Re: [PATCH 0/7] s390x/ccw: Error reporting cleanups, Eric Farman, 2024/05/23
- Re: [PATCH 0/7] s390x/ccw: Error reporting cleanups, Thomas Huth, 2024/05/27