[PATCH 1/3] drm/xe/queue: fix engine_class bounds check

Nirmoy Das nirmoy.das at intel.com
Mon Mar 18 18:42:30 UTC 2024


On 3/18/2024 7:05 PM, Matthew Auld wrote:
> The engine_class is the index into the user_to_xe_engine_class,
> therefore it needs to be less than.
>
> Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
> Signed-off-by: Matthew Auld<matthew.auld at intel.com>
> Cc: Nirmoy Das<nirmoy.das at intel.com>

Reviewed-by: Nirmoy Das <nirmoy.das at intel.com>

> ---
>   drivers/gpu/drm/xe/xe_exec_queue.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
> index 6a83bc57826a..2016c1af9633 100644
> --- a/drivers/gpu/drm/xe/xe_exec_queue.c
> +++ b/drivers/gpu/drm/xe/xe_exec_queue.c
> @@ -440,7 +440,7 @@ find_hw_engine(struct xe_device *xe,
>   {
>   	u32 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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-xe/attachments/20240318/3c8790e9/attachment.htm>


More information about the Intel-xe mailing list