linux/drivers/vdpa
Miaoqian Lin 8716a841d1 virtio: vdpa: Fix reference count leak in octep_sriov_enable()
commit b41ca62c00 upstream.

pci_get_device() will increase the reference count for the returned
pci_dev, and also decrease the reference count for the input parameter
from if it is not NULL.

If we break the loop in  with 'vf_pdev' not NULL. We
need to call pci_dev_put() to decrease the reference count.

Found via static anlaysis and this is similar to commit c508eb042d
("perf/x86/intel/uncore: Fix reference count leak in sad_cfg_iio_topology()")

Fixes: 8b6c724cda ("virtio: vdpa: vDPA driver for Marvell OCTEON DPU devices")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251027060737.33815-1-linmq006@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-02 12:57:28 +01:00
..
alibaba vdpa: introduce map ops 2025-10-01 07:24:55 -04:00
ifcvf vdpa: introduce map ops 2025-10-01 07:24:55 -04:00
mlx5 vdpa/mlx5: Fix incorrect error code reporting in query_virtqueues 2025-12-18 14:03:24 +01:00
octeon_ep virtio: vdpa: Fix reference count leak in octep_sriov_enable() 2026-01-02 12:57:28 +01:00
pds vdpa/pds: use %pe for ERR_PTR() in event handler registration 2025-12-18 14:03:24 +01:00
solidrun vdpa: introduce map ops 2025-10-01 07:24:55 -04:00
vdpa_sim vdpa: introduce map ops 2025-10-01 07:24:55 -04:00
vdpa_user vduse: Use fixed 4KB bounce pages for non-4KB page size 2025-10-01 07:24:55 -04:00
virtio_pci vdpa: introduce map ops 2025-10-01 07:24:55 -04:00
Kconfig vduse: switch to use virtio map API instead of DMA API 2025-10-01 07:24:55 -04:00
Makefile virtio: vdpa: vDPA driver for Marvell OCTEON DPU devices 2024-07-09 08:42:39 -04:00
vdpa.c vdpa: introduce map ops 2025-10-01 07:24:55 -04:00