]> git.baikalelectronics.ru Git - kernel.git/commit
bnx2x: fix pci device refcount leak in bnx2x_vf_is_pcie_pending()
authorYang Yingliang <yangyingliang@huawei.com>
Sat, 19 Nov 2022 07:02:02 +0000 (15:02 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 22 Nov 2022 12:32:26 +0000 (13:32 +0100)
commitaf8e5ad4c14f6e6541eecc150187e349a93dbeb6
tree8d064967314dc3efda66bb8fcfd17f8c300cfc45
parentd944a5eb1e74109490f08656b6451e6998da214c
bnx2x: fix pci device refcount leak in bnx2x_vf_is_pcie_pending()

As comment of pci_get_domain_bus_and_slot() says, it returns
a pci device with refcount increment, when finish using it,
the caller must decrement the reference count by calling
pci_dev_put(). Call pci_dev_put() before returning from
bnx2x_vf_is_pcie_pending() to avoid refcount leak.

Fixes: fffee62ad6e4 ("bnx2x: Prepare device and initialize VF database")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20221119070202.1407648-1-yangyingliang@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c