[Intel-xe] [PATCH] drm/xe: Initialize ret in mcr_lock()

Matt Roper matthew.d.roper at intel.com
Thu Feb 16 18:59:05 UTC 2023


On Thu, Feb 16, 2023 at 09:46:16AM -0800, José Roberto de Souza wrote:
> 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")
> Signed-off-by: José Roberto de Souza <jose.souza at intel.com>

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_gt_mcr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt_mcr.c b/drivers/gpu/drm/xe/xe_gt_mcr.c
> index bb71071c3435f..7617f03408794 100644
> --- a/drivers/gpu/drm/xe/xe_gt_mcr.c
> +++ b/drivers/gpu/drm/xe/xe_gt_mcr.c
> @@ -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);
>  
> -- 
> 2.39.1
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list