]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/amdgpu: fix error handling in amdgpu_bo_list_get()
authorChristian König <christian.koenig@amd.com>
Thu, 9 Nov 2023 09:12:39 +0000 (10:12 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 9 Nov 2023 21:59:57 +0000 (16:59 -0500)
We should not leak the pointer where we couldn't grab the reference
on to the caller because it can be that the error handling still
tries to put the reference then.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c

index 781e5c5ce04d220daee8f4f1f34ce4a45f5c4f85..702f6610d02435faa84a5853b6fed0491ea437c5 100644 (file)
@@ -172,6 +172,7 @@ int amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id,
        }
 
        rcu_read_unlock();
+       *result = NULL;
        return -ENOENT;
 }