[Intel-gfx] [PATCH] Fixes KW issue for NULL pointer dereference

Tapas Rana tapas.rana at intel.com
Thu Aug 11 13:11:01 UTC 2022


- adds a NULL pointer check for the input parameter

Signed-off-by: Tapas Rana <tapas.rana at intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
index 9a7e50534b84..de7c892aabc5 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
@@ -435,6 +435,9 @@ i915_ttm_memcpy_work_arm(struct i915_ttm_memcpy_work *work,
 static bool i915_ttm_memcpy_allowed(struct ttm_buffer_object *bo,
 				    struct ttm_resource *dst_mem)
 {
+	if (!bo)
+		return false;
+	
 	if (i915_gem_object_needs_ccs_pages(i915_ttm_to_gem(bo)))
 		return false;
 
-- 
2.25.1



More information about the Intel-gfx mailing list