Skip to content

Commit

Permalink
drm/xe/query: fix gt_id bounds check
Browse files Browse the repository at this point in the history
commit 45c30b2 upstream.

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 <matthew.auld@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Cc: <stable@vger.kernel.org> # v6.8+
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
Acked-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240321110629.334701-2-matthew.auld@intel.com
(cherry picked from commit 4b275f502a0d3668195762fb55fa00e659ad1b0b)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
matt-auld authored and gregkh committed Apr 3, 2024
1 parent a8a296a commit bd193b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_query.c
Expand Up @@ -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);
Expand Down

0 comments on commit bd193b8

Please sign in to comment.