Skip to content

Commit 235c361

Browse files
gfxstrandChristianKoenigAMD
authored andcommitted
drm/ttm: Force re-init if ttm_global_init() fails
If we have a failure, decrement the reference count so that the next call to ttm_global_init() will actually do something instead of assume everything is all set up. Signed-off-by: Jason Ekstrand <[email protected]> Fixes: 62b53b3 ("drm/ttm: use a static ttm_bo_global instance") Reviewed-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
1 parent 3abab27 commit 235c361

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/ttm/ttm_device.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ static int ttm_global_init(void)
100100
debugfs_create_atomic_t("buffer_objects", 0444, ttm_debugfs_root,
101101
&glob->bo_count);
102102
out:
103+
if (ret)
104+
--ttm_glob_use_count;
103105
mutex_unlock(&ttm_global_mutex);
104106
return ret;
105107
}

0 commit comments

Comments
 (0)