Re: [PATCH v1] octeontx2-af: Fix PCI device reference leaks in debugfs
From: Jakub Kicinski
Date: Mon Jun 01 2026 - 22:02:46 EST
On Fri, 29 May 2026 01:23:33 -0400 Yuho Choi wrote:
> Subject: [PATCH v1] octeontx2-af: Fix PCI device reference leaks in debugfs
> Date: Fri, 29 May 2026 01:23:33 -0400
> X-Mailer: git-send-email 2.43.0
>
> cgx_print_stats(), cgx_print_dmac_flt(), and cgx_print_fwdata()
> look up the RVU AF device with pci_get_device() and pass the returned
> pointer directly to pci_get_drvdata(). pci_get_device() returns a PCI
> device with an elevated reference count, so the lookup reference is
> leaked on every debugfs read.
>
> Store the returned PCI device pointer, check it before reading driver
> data, and release the lookup reference after pci_get_drvdata(). In
> cgx_print_dmac_flt(), release the AF lookup reference before reusing
> pdev for pci_get_domain_bus_and_slot().
Looks like cgx struct has a pointer to the pci dev.
Can we use that instead?
When you repost please add net-next to the subject:
[PATCH net-next v2] octeontx2-af: Fix ...
and make sure you base the change on the net-next tree
For some reason our CI wasn't able to ingest this change.
--
pw-bot: cr