Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Add a NULL check in xe_ttm_stolen_mgr_init
@ 2024-03-19 13:09 Nirmoy Das
  2024-03-19 13:42 ` Matthew Auld
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Nirmoy Das @ 2024-03-19 13:09 UTC (permalink / raw)
  To: intel-xe; +Cc: Nirmoy Das, Matthew Auld

Add an explicit check to ensure that the mgr is not NULL.

Cc: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 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 3107d2a12426..fb35e46d68b4 100644
--- a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
+++ b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
@@ -207,6 +207,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_SRIOV_VF(xe))
 		stolen_size = 0;
 	else if (IS_DGFX(xe))
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-19 14:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-19 13:09 [PATCH] drm/xe: Add a NULL check in xe_ttm_stolen_mgr_init Nirmoy Das
2024-03-19 13:42 ` Matthew Auld
2024-03-19 13:59 ` ✓ CI.Patch_applied: success for " Patchwork
2024-03-19 14:00 ` ✓ CI.checkpatch: " Patchwork
2024-03-19 14:00 ` ✓ CI.KUnit: " Patchwork
2024-03-19 14:11 ` ✓ CI.Build: " Patchwork
2024-03-19 14:14 ` ✓ CI.Hooks: " Patchwork
2024-03-19 14:15 ` ✓ CI.checksparse: " Patchwork
2024-03-19 14:36 ` ✓ CI.BAT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox