diff options
author | Matthew Auld <[email protected]> | 2024-03-21 11:06:30 +0000 |
---|---|---|
committer | Lucas De Marchi <[email protected]> | 2024-03-25 13:45:32 -0500 |
commit | 45c30b2923e5c53e0ef057a8a525b0456adde18e (patch) | |
tree | cee6a4c3174d0926f699e5b4623457e7ac058cdd | |
parent | b45f20fa69cedb6038fdaec31bd600c273c865a5 (diff) |
drm/xe/query: fix gt_id bounds check
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 <[email protected]>
Cc: Nirmoy Das <[email protected]>
Cc: <[email protected]> # v6.8+
Reviewed-by: Nirmoy Das <[email protected]>
Acked-by: Himal Prasad Ghimiray <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 4b275f502a0d3668195762fb55fa00e659ad1b0b)
Signed-off-by: Lucas De Marchi <[email protected]>
-rw-r--r-- | drivers/gpu/drm/xe/xe_query.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c index 92bb06c0586e..075f9eaef031 100644 --- a/drivers/gpu/drm/xe/xe_query.c +++ b/drivers/gpu/drm/xe/xe_query.c @@ -132,7 +132,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); |