Commit 99d54a7a authored by Christian König's avatar Christian König Committed by sanglipeng
Browse files

drm/amdgpu: fix error handling in amdgpu_bo_list_get()

stable inclusion
from stable-v5.10.202
commit e2bdd437886c4e412bd6f85b9788d26ca7943e5c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9DZOS

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e2bdd437886c4e412bd6f85b9788d26ca7943e5c



--------------------------------

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: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 030206ef
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ int amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id,
	}

	rcu_read_unlock();
	*result = NULL;
	return -ENOENT;
}