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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:07:22 +0000 (17:07 +0000)
commitc52aac5884bc58e304d4c9cb8441baf8443ea189
tree219d97b724c87ad33b6b36951b23aa6b4e4c3e2c
parent2ab6c1237bd4a961b8d5032671510a028fb9f0f6
drm/amdgpu: fix error handling in amdgpu_bo_list_get()

commit 12f76050d8d4d10dab96333656b821bd4620d103 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c