]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: fix amdgpu_preempt_mgr_new()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 18 Jun 2021 08:37:21 +0000 (11:37 +0300)
committerChristian König <christian.koenig@amd.com>
Mon, 21 Jun 2021 13:24:29 +0000 (15:24 +0200)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c

index f6aff7ce51606167435eafc6ba236f60c6b614c0..d02c8637f909fc376b749a7dde3c3fef8d7601dc 100644 (file)
@@ -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);