linux/drivers/vdpa
Miaoqian Lin f655550322 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-08 10:14:29 +01:00
..
alibaba eni_vdpa: implement vdpa_config_ops.get_vq_size 2024-03-19 02:45:50 -04:00
ifcvf vDPA/ifcvf: Fix pci_read_config_byte() return code handling 2024-11-06 04:40:07 -05:00
mlx5 vdpa/mlx5: Fix incorrect error code reporting in query_virtqueues 2025-12-18 13:55:10 +01:00
octeon_ep virtio: vdpa: Fix reference count leak in octep_sriov_enable() 2026-01-08 10:14:29 +01:00
pds vdpa/pds: use %pe for ERR_PTR() in event handler registration 2025-12-18 13:55:10 +01:00
solidrun vdpa: solidrun: Fix UB bug with devres 2024-11-06 04:40:07 -05:00
vdpa_sim vdpa_sim_net: Add the support of set mac address 2024-09-10 02:51:48 -04:00
vdpa_user vdpa: Fix IDR memory leak in VDUSE module exit 2025-08-15 12:13:58 +02:00
virtio_pci vp_vdpa: fix id_table array not null terminated error 2024-11-06 04:40:07 -05:00
Kconfig dma-mapping: clearly mark DMA ops as an architecture feature 2024-09-04 07:08:51 +03:00
Makefile virtio: vdpa: vDPA driver for Marvell OCTEON DPU devices 2024-07-09 08:42:39 -04:00
vdpa.c vdpa: support set mac address from vdpa tool 2024-09-10 02:51:48 -04:00