diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2023-12-14 13:39:52 -0800 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 11:46:17 -0500 |
commit | 40fb5ed290d49b568d8547ecfdc5bd83f217dfe1 (patch) | |
tree | 110d17c1b8534ebb4cffef06020788dc5d73e871 /drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | |
parent | 1374df38e9267bf4588fbc665b3a20afb479f5ac (diff) |
drm/xe: Return error if drm_buddy_init() fails
Fix warning:
../drivers/gpu/drm/xe/xe_ttm_vram_mgr.c: In function ‘__xe_ttm_vram_mgr_init’:
../drivers/gpu/drm/xe/xe_ttm_vram_mgr.c:340:13: error: variable ‘err’ set but not used [-Werror=unused-but-set-variable]
340 | int err;
| ^~~
Check for the error return and return it, like done by other drivers.
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_ttm_vram_mgr.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c index 953e5dc0fd80..115ec745e502 100644 --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c @@ -348,6 +348,8 @@ int __xe_ttm_vram_mgr_init(struct xe_device *xe, struct xe_ttm_vram_mgr *mgr, ttm_resource_manager_init(man, &xe->ttm, size); err = drm_buddy_init(&mgr->mm, man->size, default_page_size); + if (err) + return err; ttm_set_driver_manager(&xe->ttm, mem_type, &mgr->manager); ttm_resource_manager_set_used(&mgr->manager, true); |