From 3da3bc7fdb59c9052989662d33c14c3dd1cd5aeb Mon Sep 17 00:00:00 2001 From: Nirmoy Das Date: Tue, 19 Mar 2024 14:09:25 +0100 Subject: [PATCH] drm/xe: Add a NULL check in xe_ttm_stolen_mgr_init BugLink: https://bugs.launchpad.net/bugs/2076435 [ Upstream commit a6eff8f9c7e844cb24ccb188ca24abcd59734e74 ] Add an explicit check to ensure that the mgr is not NULL. Cc: Matthew Auld Signed-off-by: Nirmoy Das Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20240319130925.22399-1-nirmoy.das@intel.com Signed-off-by: Sasha Levin Signed-off-by: Portia Stephens Signed-off-by: Roxana Nicolescu --- drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c index e5d7d5e2bec1..968fdbe4452b 100644 --- a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c +++ b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c @@ -205,6 +205,11 @@ void xe_ttm_stolen_mgr_init(struct xe_device *xe) u64 stolen_size, io_size, pgsize; int err; + if (!mgr) { + drm_dbg_kms(&xe->drm, "Stolen mgr init failed\n"); + return; + } + if (IS_DGFX(xe)) stolen_size = detect_bar2_dgfx(xe, mgr); else if (GRAPHICS_VERx100(xe) >= 1270)