From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/v3d: Refcount v3d_stats Date: Mon, 09 Mar 2026 09:20:15 +1000 Message-ID: In-Reply-To: <20260305-v3d-reset-locking-improv-v2-3-fd53c91f7726@igalia.com> References: <20260305-v3d-reset-locking-improv-v2-0-fd53c91f7726@igalia.com> <20260305-v3d-reset-locking-improv-v2-3-fd53c91f7726@igalia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review This is the core change of the series. The design is sound: `v3d_stats` get= s a `kref` and is heap-allocated via `v3d_stats_alloc()`. The error handling in `v3d_open` is correct =E2=80=94 the two-label approac= h (`err_sched` / `err_stats`) properly handles the case where stats were al= located but `drm_sched_entity_init` failed: ```c err_sched: v3d_stats_put(v3d_priv->stats[i]); err_stats: for (i--; i >=3D 0; i--) { drm_sched_entity_destroy(&v3d_priv->sched_entity[i]); v3d_stats_put(v3d_priv->stats[i]); } ``` The `v3d_gem_init` error handling is also correctly reworked =E2=80=94 prev= ious bare `return -ENOMEM` / `return ret` paths that leaked stats are now r= outed through proper cleanup labels. The reordering that separates `drm_mm_= takedown` from the DMA alloc failure path (`err_dma_alloc` vs `err_sched`) = is correct. One observation: `v3d_stats_release` and `v3d_stats_alloc` are placed in `v= 3d_sched.c` rather than, say, `v3d_drv.c` where `v3d_get_stats` lives. This= is fine since `v3d_sched.c` is the primary consumer, but worth noting for = future reference. --- Generated by Claude Code Patch Reviewer