mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
vfio/container: Fix SIGSEGV when open container file fails
When open /dev/vfio/vfio fails, SIGSEGV triggers because
vfio_listener_unregister() doesn't support a NULL bcontainer
pointer.
Fixes: a1f267a7d4 ("vfio/container: reform vfio_container_connect cleanup")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250623102235.94877-2-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
committed by
Cédric Le Goater
parent
eafb408629
commit
abc6249d42
+3
-1
@@ -710,7 +710,9 @@ static bool vfio_container_connect(VFIOGroup *group, AddressSpace *as,
|
||||
return true;
|
||||
|
||||
fail:
|
||||
vfio_listener_unregister(bcontainer);
|
||||
if (new_container) {
|
||||
vfio_listener_unregister(bcontainer);
|
||||
}
|
||||
|
||||
if (group_was_added) {
|
||||
vfio_container_group_del(container, group);
|
||||
|
||||
Reference in New Issue
Block a user