author: Zheyu Ma <zheyuma97@gmail.com> 2021-07-14 14:54:19 +0000
committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-07-31 08:13:46 +0200
commit: 37ac00a0d35881cbf77302ac3fe011e07e5f6e02
parent: f11bec89ad63aa4b23df5c62713e17075701ab19
Commit Summary:
Diffstat:
1 file changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_range_manager.c b/drivers/gpu/drm/ttm/ttm_range_manager.c
index 707e5c152896..ed053fd15c90 100644
--- a/drivers/gpu/drm/ttm/ttm_range_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_range_manager.c
@@ -146,6 +146,9 @@ int ttm_range_man_fini(struct ttm_device *bdev,
struct drm_mm *mm = &rman->mm;
int ret;
+ if (!man)
+ return 0;
+
ttm_resource_manager_set_used(man, false);
ret = ttm_resource_manager_evict_all(bdev, man);