Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: fix amdgpu_preempt_mgr_new()

There is a reversed if statement in amdgpu_preempt_mgr_new() so it
always returns -ENOMEM.

Fixes: 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/YMxbQXg/Wqm0ACxt@mwanda
Signed-off-by: Christian König <christian.koenig@amd.com>

authored by

Dan Carpenter and committed by
Christian König
eed75ce7 24ff3dc1

+1 -1
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
··· 71 71 struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man); 72 72 73 73 *res = kzalloc(sizeof(**res), GFP_KERNEL); 74 - if (*res) 74 + if (!*res) 75 75 return -ENOMEM; 76 76 77 77 ttm_resource_init(tbo, place, *res);