From: Christian König Date: Thu, 9 Nov 2023 09:12:39 +0000 (+0100) Subject: drm/amdgpu: fix error handling in amdgpu_bo_list_get() X-Git-Tag: v6.7-rc6-pxa1908~207^2^2~28 X-Git-Url: https://git.dujemihanovic.xyz/?a=commitdiff_plain;h=12f76050d8d4d10dab96333656b821bd4620d103;p=linux.git drm/amdgpu: fix error handling in amdgpu_bo_list_get() 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 Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c index 781e5c5ce04d..702f6610d024 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c @@ -172,6 +172,7 @@ int amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id, } rcu_read_unlock(); + *result = NULL; return -ENOENT; }