All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Fix a NULL deref in amdgpu_vm_add_prt_cb()
@ 2017-04-03 18:41 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-04-03 18:41 UTC (permalink / raw)
  To: Alex Deucher, Christian König
  Cc: kernel-janitors, amd-gfx, dri-devel, Junwei Zhang,
	Edward O'Callaghan, Alex Xie

We accidentally dereference "cb" if the kmalloc() fails.

Fixes: 451bc8eb8fe6 ("drm/amdgpu: fix PRT teardown on VM fini v3")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 0235d7933efd..45a1bcfc41f7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1518,7 +1518,7 @@ static void amdgpu_vm_add_prt_cb(struct amdgpu_device *adev,
 		if (fence)
 			dma_fence_wait(fence, false);
 
-		amdgpu_vm_prt_put(cb->adev);
+		amdgpu_vm_prt_put(adev);
 	} else {
 		cb->adev = adev;
 		if (!fence || dma_fence_add_callback(fence, &cb->cb,

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

end of thread, other threads:[~2017-04-04  6:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03 18:41 [PATCH] drm/amdgpu: Fix a NULL deref in amdgpu_vm_add_prt_cb() Dan Carpenter
2017-04-03 18:41 ` Dan Carpenter
2017-04-03 18:53 ` Harry Wentland
2017-04-03 18:53   ` Harry Wentland
2017-04-03 20:36   ` Alex Deucher
2017-04-03 20:36     ` Alex Deucher
2017-04-04  6:34     ` Christian König
2017-04-04  6:34       ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.