]> Git Repo - linux.git/commitdiff
drm/xe/queue: fix engine_class bounds check
authorMatthew Auld <[email protected]>
Mon, 18 Mar 2024 18:05:33 +0000 (18:05 +0000)
committerLucas De Marchi <[email protected]>
Mon, 25 Mar 2024 18:45:32 +0000 (13:45 -0500)
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 <[email protected]>
Cc: Nirmoy Das <[email protected]>
Reviewed-by: Nirmoy Das <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit fe87b7dfcb204a161d1e38b0e787b2f5ab520f32)
Signed-off-by: Lucas De Marchi <[email protected]>
drivers/gpu/drm/xe/xe_exec_queue.c

index 11e150f4c0c1f753bf344224b433f26231efd782..ead25d5e723ea501890761f7c0d96b0c0a79d871 100644 (file)
@@ -448,7 +448,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)
This page took 0.063539 seconds and 4 git commands to generate.