]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
octeontx2-af: debugsfs: fix pci device refcount leak
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 17 Nov 2022 12:46:58 +0000 (20:46 +0800)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 13:00:27 +0000 (14:00 +0100)
commit2547c68640f72613ce2cbe1bfafadcfd95c0a3a9
tree4af496f63b49de9ff3591710a254fc94ed332ee3
parent6ba317b1285e0c9152ca1938d1a617987e89d2b7
octeontx2-af: debugsfs: fix pci device refcount leak

[ Upstream commit d66608803aa2ffb9e475623343f69996305771ae ]

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().

So before returning from rvu_dbg_rvu_pf_cgx_map_display() or
cgx_print_dmac_flt(), pci_dev_put() is called to avoid refcount
leak.

Fixes: dbc52debf95f ("octeontx2-af: Debugfs support for DMAC filters")
Fixes: e2fb37303865 ("octeontx2-af: Display CGX, NIX and PF map in debugfs.")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221117124658.162409-1-yangyingliang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit f77c84dd5b28f4fb85bb8c0c0ff51c6870877f7f)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c