Re: [PATCH v1] PCI: Release SR-IOV device reference on init failure

[email protected]
Newsgroups org.kernel.vger.linux-pci
Message-ID <[email protected]>
> sriov_init() takes a reference on the sibling physical function stored in
> pci_sriov->dev before computing the maximum VF bus usage. If
> compute_max_vf_buses() fails, the failure path clears the SR-IOV state and
> frees pci_sriov without releasing that reference. Since is_physfn is
> cleared, pci_iov_release() cannot clean it up later.
> 
> Release the reference on the failure path when pci_sriov->dev is different
> from the device being initialized, matching the cleanup in sriov_release().
> 
> Fixes: ea9a8854161d ("PCI: Set SR-IOV NumVFs to zero after enumeration")
> Signed-off-by: Yuho Choi <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.