We are observing a NULL value in the non userq fences,
thus added a NULL pointer check just to avoid the
NULL pointer dereference crash.

Signed-off-by: Arunpravin Paneer Selvam <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
index 6157a540c929..482346333a89 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
@@ -821,6 +821,9 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void 
*data,
                                 * Just waiting on other driver fences should
                                 * be good for now
                                 */
+                               if (fences[i])
+                                       continue;
+
                                r = dma_fence_wait(fences[i], true);
                                if (r) {
                                        dma_fence_put(fences[i]);
-- 
2.25.1

Reply via email to