diff options
author | Eric Auger <eric.auger@redhat.com> | 2023-10-11 22:09:34 +0200 |
---|---|---|
committer | Cédric Le Goater <clg@redhat.com> | 2023-10-18 10:10:49 +0200 |
commit | c0f527f4cc6659f55279f7d774dd804a1504a401 (patch) | |
tree | 6fed4cc1057a8c227bfe40370fe357f03079c89d /chardev/char-serial.c | |
parent | 410ee49190f46b4e545acee9cb70717e12d8305b (diff) | |
download | qemu-c0f527f4cc6659f55279f7d774dd804a1504a401.zip qemu-c0f527f4cc6659f55279f7d774dd804a1504a401.tar.gz qemu-c0f527f4cc6659f55279f7d774dd804a1504a401.tar.bz2 |
vfio/pci: Remove vfio_detach_device from vfio_realize error path
In vfio_realize, on the error path, we currently call
vfio_detach_device() after a successful vfio_attach_device.
While this looks natural, vfio_instance_finalize also induces
a vfio_detach_device(), and it seems to be the right place
instead as other resources are released there which happen
to be a prerequisite to a successful UNSET_CONTAINER.
So let's rely on the finalize vfio_detach_device call to free
all the relevant resources.
Fixes: a28e06621170 ("vfio/pci: Introduce vfio_[attach/detach]_device")
Reported-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'chardev/char-serial.c')
0 files changed, 0 insertions, 0 deletions