[PATCH] drm/xe/query: fix gt_id bounds check

Nirmoy Das nirmoy.das at intel.com
Thu Mar 21 11:10:58 UTC 2024


On 3/21/2024 12:06 PM, Matthew Auld wrote:
> The user provided gt_id should always be less than the
> XE_MAX_GT_PER_TILE.
>
> Fixes: 7793d00d1bf5 ("drm/xe: Correlate engine and cpu timestamps with better accuracy")
> Signed-off-by: Matthew Auld<matthew.auld at intel.com>
> Cc: Nirmoy Das<nirmoy.das at intel.com>
> Cc:<stable at vger.kernel.org>  # v6.8+
Reviewed-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_query.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
> index fcd8680d2ccc..df407d73e5f5 100644
> --- a/drivers/gpu/drm/xe/xe_query.c
> +++ b/drivers/gpu/drm/xe/xe_query.c
> @@ -133,7 +133,7 @@ query_engine_cycles(struct xe_device *xe,
>   		return -EINVAL;
>   
>   	eci = &resp.eci;
> -	if (eci->gt_id > XE_MAX_GT_PER_TILE)
> +	if (eci->gt_id >= XE_MAX_GT_PER_TILE)
>   		return -EINVAL;
>   
>   	gt = xe_device_get_gt(xe, eci->gt_id);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-xe/attachments/20240321/9091228d/attachment.htm>


More information about the Intel-xe mailing list