Skip to content

Commit

Permalink
pcie: Release references of virtual functions
Browse files Browse the repository at this point in the history
pci_new() automatically retains a reference to a virtual function when
registering it so we need to release the reference when unregistering.

Fixes: 7c0fa8d ("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>
  • Loading branch information
akihikodaki authored and mstsirkin committed Jul 10, 2023
1 parent c925f40 commit 08f6328
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/pci/pcie_sriov.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ static void unregister_vfs(PCIDevice *dev)
error_free(local_err);
}
object_unparent(OBJECT(vf));
object_unref(OBJECT(vf));
}
g_free(dev->exp.sriov_pf.vf);
dev->exp.sriov_pf.vf = NULL;
Expand Down

0 comments on commit 08f6328

Please sign in to comment.