Commit 486a68f5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Alex Deucher

drm/amdgpu: Fix a NULL deref in amdgpu_vm_add_prt_cb()

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

Fixes: 451bc8eb ("drm/amdgpu: fix PRT teardown on VM fini v3")
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 99147e64
...@@ -1528,7 +1528,7 @@ static void amdgpu_vm_add_prt_cb(struct amdgpu_device *adev, ...@@ -1528,7 +1528,7 @@ static void amdgpu_vm_add_prt_cb(struct amdgpu_device *adev,
if (fence) if (fence)
dma_fence_wait(fence, false); dma_fence_wait(fence, false);
amdgpu_vm_prt_put(cb->adev); amdgpu_vm_prt_put(adev);
} else { } else {
cb->adev = adev; cb->adev = adev;
if (!fence || dma_fence_add_callback(fence, &cb->cb, if (!fence || dma_fence_add_callback(fence, &cb->cb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment