mirror of https://github.com/xemu-project/xemu.git
pcie: Release references of virtual functions
pci_new() automatically retains a reference to a virtual function when
registering it so we need to release the reference when unregistering.
Fixes: 7c0fa8dff8
("pcie: Add support for Single Root I/O Virtualization (SR/IOV)")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230411090408.48366-1-akihiko.odaki@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
This commit is contained in:
parent
c925f40a29
commit
08f6328480
|
@ -211,6 +211,7 @@ static void unregister_vfs(PCIDevice *dev)
|
||||||
error_free(local_err);
|
error_free(local_err);
|
||||||
}
|
}
|
||||||
object_unparent(OBJECT(vf));
|
object_unparent(OBJECT(vf));
|
||||||
|
object_unref(OBJECT(vf));
|
||||||
}
|
}
|
||||||
g_free(dev->exp.sriov_pf.vf);
|
g_free(dev->exp.sriov_pf.vf);
|
||||||
dev->exp.sriov_pf.vf = NULL;
|
dev->exp.sriov_pf.vf = NULL;
|
||||||
|
|
Loading…
Reference in New Issue