]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 13:00:28 +0000 (14:00 +0100)
commitd17cd6e43793680ef0155424775354e5929f8341
treecf94e219d0758b4bb94dc8d8e020349b3fe294d0
parent74fce6ed62a94f19796ef4b545fdd050e3a0d101
bnx2x: fix pci device refcount leak in bnx2x_vf_is_pcie_pending()

[ Upstream commit 3637a29ccbb6461b7268c5c5db525935d510afc6 ]

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: b56e9670ffa4 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 8af9450befbadca0097719d2388547e7388e006d)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c