]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/xe: Check return value of GGTT workqueue allocation
authorMatthew Brost <matthew.brost@intel.com>
Wed, 22 Oct 2025 00:55:36 +0000 (17:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:10:25 +0000 (14:10 +0100)
commit ce29214ada6d08dbde1eeb5a69c3b09ddf3da146 upstream.

Workqueue allocation can fail, so check the return value of the GGTT
workqueue allocation and fail driver initialization if the allocation
fails.

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/20251022005538.828980-2-matthew.brost@intel.com
(cherry picked from commit 1f1314e8e71385bae319e43082b798c11f6648bc)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/xe/xe_ggtt.c

index 29d4d3f51da17b7020348104565645792325de2d..8f7b2603e47f226ab52a5d9a5ef93638e14c3d6c 100644 (file)
@@ -291,6 +291,9 @@ int xe_ggtt_init_early(struct xe_ggtt *ggtt)
                ggtt->pt_ops = &xelp_pt_ops;
 
        ggtt->wq = alloc_workqueue("xe-ggtt-wq", 0, WQ_MEM_RECLAIM);
+       if (!ggtt->wq)
+               return -ENOMEM;
+
        __xe_ggtt_init_early(ggtt, xe_wopcm_size(xe));
 
        err = drmm_add_action_or_reset(&xe->drm, ggtt_fini_early, ggtt);