[PATCH 13/13] a hack
Andi Shyti
andi.shyti at linux.intel.com
Sun Dec 12 10:47:00 UTC 2021
---
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 9 +++++++--
drivers/gpu/drm/i915/selftests/i915_vma.c | 9 +++++++--
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 06ae753aa4a2..3b1c50ea3f45 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -1744,7 +1744,11 @@ int i915_gem_gtt_mock_selftests(void)
if (!i915)
return -ENOMEM;
- ggtt = &to_gt(i915)->ggtt;
+ ggtt = kmalloc(sizeof(*ggtt), GFP_KERNEL);
+ if (!ggtt) {
+ err = -ENOMEM;
+ goto out_put;
+ }
mock_init_ggtt(i915, ggtt);
err = i915_subtests(tests, ggtt);
@@ -1753,7 +1757,8 @@ int i915_gem_gtt_mock_selftests(void)
i915_gem_drain_freed_objects(i915);
mock_fini_ggtt(ggtt);
mock_destroy_device(i915);
-
+ kfree(ggtt);
+out_put:
return err;
}
diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c
index d80d95144135..3064aff9d26e 100644
--- a/drivers/gpu/drm/i915/selftests/i915_vma.c
+++ b/drivers/gpu/drm/i915/selftests/i915_vma.c
@@ -914,7 +914,11 @@ int i915_vma_mock_selftests(void)
if (!i915)
return -ENOMEM;
- ggtt = &to_gt(i915)->ggtt;
+ ggtt = kmalloc(sizeof(*ggtt), GFP_KERNEL);
+ if (!ggtt) {
+ err = -ENOMEM;
+ goto out_put;
+ }
mock_init_ggtt(i915, ggtt);
err = i915_subtests(tests, ggtt);
@@ -923,7 +927,8 @@ int i915_vma_mock_selftests(void)
i915_gem_drain_freed_objects(i915);
mock_fini_ggtt(ggtt);
mock_destroy_device(i915);
-
+ kfree(ggtt);
+out_put:
return err;
}
--
2.34.1
More information about the Intel-gfx-trybot
mailing list