Re: [PATCH v3 2/4] drm/amdgpu: jump to the correct label on failure

From: Pierre-Eric Pelloux-Prayer

Date: Fri Nov 07 2025 - 04:05:59 EST




Le 06/11/2025 à 11:21, Christian König a écrit :
On 11/6/25 10:56, Tvrtko Ursulin wrote:

On 06/11/2025 09:39, Pierre-Eric Pelloux-Prayer wrote:
drm_sched_entity_init wasn't called yet, so the only thing to
do is to release allocated memory.
This doesn't fix any bug since entity is zero allocated and
drm_sched_entity_fini does nothing in this case.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@xxxxxxx>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index f5d5c45ddc0d..afedea02188d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -236,7 +236,7 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
          r = amdgpu_xcp_select_scheds(adev, hw_ip, hw_prio, fpriv,
                          &num_scheds, &scheds);
          if (r)
-            goto cleanup_entity;
+            goto error_free_entity;
      }
        /* disable load balance if the hw engine retains context among dependent jobs */

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxx>

Acked-by: Christian König <christian.koenig@xxxxxxx>

Since this is still a fix please push it to amd-staging-drm-next independent of the remaining patch set.

Ok, I removed this patch from v4 and will push it to amd-staging-drm-next.

Pierre-Eric