Skip to contentSkip to conversation

drm/xe: Initialize ret in mcr_lock()

PATCH In review José Roberto de Souza 2 participants 2 messages Feb 16, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/xe: Initialize ret in mcr_lock()

ret is not initialized in mcr_lock() when running in platforms with graphics IP version < 1270, this could cause drm_WARN_ON_ONCE() to hit eventually(what just happened to me).

Fixes 62a813fa315e ("drm/xe: Introduce a new DRM driver for Intel GPUs")
---
 drivers/gpu/drm/xe/xe_gt_mcr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_gt_mcr.c +1 -1
index bb71071c3435f..7617f03408794 100644
@@ -383,7 +383,7 @@ static bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt,
 static void mcr_lock(struct xe_gt *gt)
 {
 	struct xe_device *xe = gt_to_xe(gt);
-	int ret;
+	int ret = 0;
 
 	spin_lock(&gt->mcr_lock);
 
Signature · 1 line
2.39.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · José Roberto de Souza

ret is not initialized in mcr_lock() when running in platforms with graphics IP version < 1270, this could cause drm_WARN_ON_ONCE() to hit eventually(what just happened to me).

Fixes 62a813fa315e ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Quoted 20 lines
---
 drivers/gpu/drm/xe/xe_gt_mcr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_gt_mcr.c +1 -1
index bb71071c3435f..7617f03408794 100644
@@ -383,7 +383,7 @@ static bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt,
 static void mcr_lock(struct xe_gt *gt)
 {
 	struct xe_device *xe = gt_to_xe(gt);
-	int ret;
+	int ret = 0;
 
 	spin_lock(&gt->mcr_lock);
 
Signature · 1 line
2.39.1
Signature · 4 lines
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation