linux/drivers/gpu/drm/v3d
Maíra Canal 6bf7e2affc
drm/v3d: Fix global performance monitor reference counting
In the SET_GLOBAL ioctl, v3d_perfmon_find() bumps the reference count on
the perfmon it returns, but v3d_perfmon_set_global_ioctl() and
v3d_perfmon_delete() fail to release that reference on several paths:

  1. v3d_perfmon_set_global_ioctl() leaks the reference on its error
     paths.

  2. CLEAR_GLOBAL leaks both the find reference and the reference
     previously stashed in v3d->global_perfmon by the SET_GLOBAL ioctl
     that configured it.

  3. Destroying a perfmon that is the current global perfmon leaks the
     reference stashed by the SET_GLOBAL ioctl.

Release each of these references explicitly.

Cc: stable@vger.kernel.org
Fixes: c6eabbab35 ("drm/v3d: Add DRM_IOCTL_V3D_PERFMON_SET_GLOBAL")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Link: https://patch.msgid.link/20260531-v3d-perfmon-lifetime-v2-1-60ed4485a203@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com>
2026-06-04 11:37:28 -03:00
..
Kconfig drm/v3d: Add support for bcm2711 2022-06-12 22:10:50 -01:00
Makefile drm/v3d: Use huge tmpfs mountpoint helpers 2025-12-08 10:52:47 +01:00
v3d_bo.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
v3d_debugfs.c drm: include drm_print.h where needed 2025-10-31 10:34:52 +02:00
v3d_drv.c drm/v3d: Attach per-fd reset counters to v3d_stats 2026-03-13 18:02:32 -03:00
v3d_drv.h drm/v3d: Remove dedicated fence_lock 2026-03-13 18:02:32 -03:00
v3d_fence.c drm/v3d: Remove dedicated fence_lock 2026-03-13 18:02:32 -03:00
v3d_gem.c drm/v3d: Wait for pending L2T flush before cleaning caches 2026-06-01 15:26:04 -03:00
v3d_irq.c drm/v3d: Hold v3d_stats references in each job 2026-03-13 18:02:32 -03:00
v3d_mmu.c drm/v3d: Convert v3d logging to device-based DRM helpers 2026-01-19 07:12:25 -03:00
v3d_perfmon.c drm/v3d: Fix global performance monitor reference counting 2026-06-04 11:37:28 -03:00
v3d_performance_counters.h drm/v3d: Fix miscellaneous documentation errors 2024-12-11 10:06:14 -03:00
v3d_regs.h drm/v3d: Use V3D_SMS registers for power on/off and reset on V3D 7.x 2025-03-23 11:06:15 -03:00
v3d_sched.c drm/v3d: Skip CSD when it has zeroed workgroups 2026-06-03 08:19:54 -03:00
v3d_submit.c drm/v3d: Release indirect CSD GEM reference on CPU job free 2026-05-18 19:59:51 -03:00
v3d_sysfs.c drm/v3d: Refcount v3d_stats 2026-03-13 18:02:32 -03:00
v3d_trace_points.c
v3d_trace.h drm/v3d: Create tracepoints to track the CPU job 2023-12-01 09:37:48 -03:00