[PATCH] drm/xe: fix engine_class bounds check again

Cavitt, Jonathan jonathan.cavitt at intel.com
Mon Aug 12 14:22:41 UTC 2024


-----Original Message-----
From: Intel-xe <intel-xe-bounces at lists.freedesktop.org> On Behalf Of Matthew Auld
Sent: Monday, August 12, 2024 7:14 AM
To: intel-xe at lists.freedesktop.org
Cc: Grzegorzek, Dominik <dominik.grzegorzek at intel.com>; Mika Kuoppala <mika.kuoppala at linux.intel.com>; Brost, Matthew <matthew.brost at intel.com>
Subject: [PATCH] drm/xe: fix engine_class bounds check again
> 
> This was fixed in commit b7dce525c4fc ("drm/xe/queue: fix engine_class
> bounds check"), but then re-introduced in commit 6f20fc09936e ("drm/xe:
> Move and export xe_hw_engine lookup.") which should only be simple code
> movement of the existing function.
> 
> Fixes: 6f20fc09936e ("drm/xe: Move and export xe_hw_engine lookup.")
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
> Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> Cc: Matthew Brost <matthew.brost at intel.com>

Verified.  LGTM.
Reviewed-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
-Jonathan Cavitt

> ---
>  drivers/gpu/drm/xe/xe_hw_engine.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
> index 402dfa748e16..e195022ca836 100644
> --- a/drivers/gpu/drm/xe/xe_hw_engine.c
> +++ b/drivers/gpu/drm/xe/xe_hw_engine.c
> @@ -1189,7 +1189,7 @@ xe_hw_engine_lookup(struct xe_device *xe,
>  {
>  	unsigned int idx;
>  
> -	if (eci.engine_class > ARRAY_SIZE(user_to_xe_engine_class))
> +	if (eci.engine_class >= ARRAY_SIZE(user_to_xe_engine_class))
>  		return NULL;
>  
>  	if (eci.gt_id >= xe->info.gt_count)
> -- 
> 2.46.0
> 
> 


More information about the Intel-xe mailing list