On 31/05/26 17:18, Maíra Canal wrote:
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: [email protected]
Fixes: c6eabbab359c ("drm/v3d: Add DRM_IOCTL_V3D_PERFMON_SET_GLOBAL")
Signed-off-by: Maíra Canal <[email protected]>
---
  drivers/gpu/drm/v3d/v3d_perfmon.c | 24 +++++++++++++++++++-----
  1 file changed, 19 insertions(+), 5 deletions(-)


Applied to drm/misc/kernel.git (drm-misc-fixes).

The rest of the patches must to wait for its dependencies to land.

Thanks for the review, Iago!

Best Regards,
- Maíra

Reply via email to