Skip to content

Commit

Permalink
drm/xe: Return error if drm_buddy_init() fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lucas De Marchi authored and Rodrigo Vivi committed Dec 21, 2023
1 parent 1374df3 commit 40fb5ed
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 40fb5ed

Please sign in to comment.