Skip to content

Commit eed75ce

Browse files
Dan CarpenterChristianKoenigAMD
authored andcommitted
drm/amdgpu: fix amdgpu_preempt_mgr_new()
There is a reversed if statement in amdgpu_preempt_mgr_new() so it always returns -ENOMEM. Fixes: 09b020b ("Merge tag 'drm-misc-next-2021-06-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/YMxbQXg/Wqm0ACxt@mwanda Signed-off-by: Christian König <[email protected]>
1 parent 24ff3dc commit eed75ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct ttm_resource_manager *man,
7171
struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
7272

7373
*res = kzalloc(sizeof(**res), GFP_KERNEL);
74-
if (*res)
74+
if (!*res)
7575
return -ENOMEM;
7676

7777
ttm_resource_init(tbo, place, *res);

0 commit comments

Comments
 (0)