[PATCH] drm/xe: Add check for alloc_ordered_workqueue()
Haoxiang Li
haoxiang_li2024 at 163.com
Wed Feb 19 09:56:59 UTC 2025
Add check for the return value of alloc_ordered_workqueue()
in xe_gt_alloc() to catch potential exception.
Fixes: e2d84e5b2205 ("drm/xe: Mark GT work queue with WQ_MEM_RECLAIM")
Cc: stable at vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024 at 163.com>
---
drivers/gpu/drm/xe/xe_gt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 5d6fb79957b6..0f42bbcb8d42 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -79,6 +79,8 @@ struct xe_gt *xe_gt_alloc(struct xe_tile *tile)
gt->tile = tile;
gt->ordered_wq = alloc_ordered_workqueue("gt-ordered-wq",
WQ_MEM_RECLAIM);
+ if (!gt->ordered_wq)
+ return ERR_PTR(-ENOMEM);
err = drmm_add_action_or_reset(>_to_xe(gt)->drm, gt_fini, gt);
if (err)
--
2.25.1
More information about the Intel-xe
mailing list