[PATCH 07/22] drm/amdgpu: fix fence_emit NULL pointer ref risk
Monk Liu
Monk.Liu at amd.com
Mon Feb 26 05:18:05 UTC 2018
Change-Id: Ic39de73338d515d4e33a828f445d8a3c3ba544bb
Signed-off-by: Monk Liu <Monk.Liu at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index 008e198..401d710 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -163,7 +163,8 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct dma_fence **f)
rcu_assign_pointer(*ptr, dma_fence_get(&fence->base));
- *f = &fence->base;
+ if (f)
+ *f = &fence->base;
return 0;
}
--
2.7.4
More information about the amd-gfx
mailing list