linux/drivers/vdpa
Anders Roxell d9ea58b5dc vdpa: Fix IDR memory leak in VDUSE module exit
Add missing idr_destroy() call in vduse_exit() to properly free the
vduse_idr radix tree nodes. Without this, module load/unload cycles leak
576-byte radix tree node allocations, detectable by kmemleak as:

unreferenced object (size 576):
  backtrace:
    [<ffffffff81234567>] radix_tree_node_alloc+0xa0/0xf0
    [<ffffffff81234568>] idr_get_free+0x128/0x280

The vduse_idr is initialized via DEFINE_IDR() at line 136 and used throughout
the VDUSE (vDPA Device in Userspace) driver for device ID management. The fix
follows the documented pattern in lib/idr.c and matches the cleanup approach
used by other drivers.

This leak was discovered through comprehensive module testing with cumulative
kmemleak detection across 10 load/unload iterations per module.

Fixes: c8a6153b6c ("vduse: Introduce VDUSE - vDPA Device in Userspace")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Message-Id: <20250704125335.1084649-1-anders.roxell@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2025-08-01 09:11:08 -04: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 release of uninitialized resources on error path 2025-08-01 09:11:08 -04:00
octeon_ep vdpa/octeon_ep: Control PCI dev enabling manually 2025-05-27 10:27:53 -04:00
pds vdpa: Remove unused declarations 2024-09-25 07:07:43 -04:00
solidrun vdpa: solidrun: Replace deprecated PCI functions 2025-01-27 09:39:25 -05:00
vdpa_sim treewide: Introduce kthread_run_worker[_on_cpu]() 2025-01-08 18:15:03 +01:00
vdpa_user vdpa: Fix IDR memory leak in VDUSE module exit 2025-08-01 09:11:08 -04:00
virtio_pci vdpa/vp_vdpa: implement kick_vq_with_data callback 2025-01-08 07:29:05 -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