Skip to content

Commit

Permalink
drm/amdgpu: fix amdgpu_preempt_mgr_new()
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
Dan Carpenter authored and Christian König committed Jun 21, 2021
1 parent 24ff3dc commit eed75ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct ttm_resource_manager *man,
struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);

*res = kzalloc(sizeof(**res), GFP_KERNEL);
if (*res)
if (!*res)
return -ENOMEM;

ttm_resource_init(tbo, place, *res);
Expand Down

0 comments on commit eed75ce

Please sign in to comment.