All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix vm_cpu_update hit NULL pointer
@ 2019-03-22  5:30 Monk Liu
       [not found] ` <1553232632-27710-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Monk Liu @ 2019-03-22  5:30 UTC (permalink / raw)
  To: amd-gfx-CC+yJ3UmIYqDUpFQwHEjaQ; +Cc: Monk Liu

should use amdgpu_bo_map, otherwise you'll hit NULL
pointer bug if with amdgpu_bo_kptr

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c
index 9d53982..1fb6295a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c
@@ -76,8 +76,10 @@ static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p,
 {
 	unsigned int i;
 	uint64_t value;
+	void *ptr;
 
-	pe += (unsigned long)amdgpu_bo_kptr(bo);
+	amdgpu_bo_kmap(bo, &ptr);
+	pe += (unsigned long)ptr;
 
 	trace_amdgpu_vm_set_ptes(pe, addr, count, incr, flags);
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2019-03-25 12:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22  5:30 [PATCH] drm/amdgpu: fix vm_cpu_update hit NULL pointer Monk Liu
     [not found] ` <1553232632-27710-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2019-03-22 15:42   ` Christian König
     [not found]     ` <583e1755-3c2a-8677-dda0-2f10ed8fc09a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-03-24  3:42       ` Liu, Monk
     [not found]         ` <BYAPR12MB33014544E9805DC79F9E3EA1845D0-ZGDeBxoHBPmRc1D8ZEEGsgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-25 12:14           ` 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.