[PATCH] drm/xe: Add check for alloc_ordered_workqueue()
Lucas De Marchi
lucas.demarchi at intel.com
Wed Feb 19 15:00:49 UTC 2025
On Wed, Feb 19, 2025 at 05:56:59PM +0800, Haoxiang Li wrote:
>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>
Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>
thanks
Lucas De Marchi
>---
> 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