linux/drivers/vdpa/octeon_ep
Miaoqian Lin b41ca62c00 virtio: vdpa: Fix reference count leak in octep_sriov_enable()
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>
2025-11-27 02:03:06 -05:00
..
Makefile
octep_vdpa.h vdpa/octeon_ep: read vendor-specific PCI capability 2025-01-27 09:39:25 -05:00
octep_vdpa_hw.c vdpa/octeon_ep: read vendor-specific PCI capability 2025-01-27 09:39:25 -05:00
octep_vdpa_main.c virtio: vdpa: Fix reference count leak in octep_sriov_enable() 2025-11-27 02:03:06 -05:00