[Intel-gfx] [PATCH] drm/i915: Fix uninitialised variable in intel_context_create_request.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Fri Sep 18 11:12:08 UTC 2020


In case backoff fails with an error, we return an undefined rq,
assign err to rq correctly.

Fixes: 8a929c9eb1c2 ("drm/i915: Use ww pinning for intel_context_create_request()")
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_context.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
index d301dda1b261..92a3f25c4006 100644
--- a/drivers/gpu/drm/i915/gt/intel_context.c
+++ b/drivers/gpu/drm/i915/gt/intel_context.c
@@ -472,6 +472,7 @@ struct i915_request *intel_context_create_request(struct intel_context *ce)
 		err = i915_gem_ww_ctx_backoff(&ww);
 		if (!err)
 			goto retry;
+		rq = ERR_PTR(err);
 	} else {
 		rq = ERR_PTR(err);
 	}

base-commit: 5887fa2d8b9b7f6a278f9a1bc8642cb9d5d0279a
-- 
2.28.0



More information about the Intel-gfx mailing list