Skip to content

Commit 45c30b2

Browse files
matt-auldlucasdemarchi
authored andcommitted
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: 7793d00 ("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 4b275f5) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent b45f20f commit 45c30b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/xe/xe_query.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ query_engine_cycles(struct xe_device *xe,
132132
return -EINVAL;
133133

134134
eci = &resp.eci;
135-
if (eci->gt_id > XE_MAX_GT_PER_TILE)
135+
if (eci->gt_id >= XE_MAX_GT_PER_TILE)
136136
return -EINVAL;
137137

138138
gt = xe_device_get_gt(xe, eci->gt_id);

0 commit comments

Comments
 (0)