VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   34 Branches   58 Tags
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:
drm/ttm: add a check against null pointer dereference
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);