kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix amdgpu_preempt_mgr_new()
@ 2021-06-18  8:37 Dan Carpenter
  2021-06-18  8:39 ` Christian König
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2021-06-18  8:37 UTC (permalink / raw)
  To: Alex Deucher, Dave Airlie
  Cc: Christian König, Pan, Xinhui, David Airlie, Daniel Vetter,
	Felix Kuehling, amd-gfx, dri-devel, kernel-janitors

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>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
index f6aff7ce5160..d02c8637f909 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
@@ -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);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-21 10:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18  8:37 [PATCH] drm/amdgpu: fix amdgpu_preempt_mgr_new() Dan Carpenter
2021-06-18  8:39 ` Christian König
2021-06-18 15:40   ` Felix Kuehling
2021-06-18 21:18     ` Alex Deucher
2021-06-21 10:27       ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).