summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tests
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@redhat.com>2023-08-10 01:50:14 +0300
committerChristian König <christian.koenig@amd.com>2023-08-10 10:01:00 +0300
commit806fd6d005ad7aa9e217d47063e5b12b25143402 (patch)
tree3d3f3fa7573e079c5d19cc4487f6659dd750622b /drivers/gpu/drm/tests
parentd01cb0457de7acf67eee2ff674eaf5fed6b969ef (diff)
downloadlinux-806fd6d005ad7aa9e217d47063e5b12b25143402.tar.xz
drm/test: drm_exec: fix memory leak on object prepare
drm_exec_prepare_obj() and drm_exec_prepare_array() both reserve dma-fence slots and hence a dma_resv_list without ever freeing it. Make sure to call drm_gem_private_object_fini() for each GEM object passed to drm_exec_prepare_obj()/drm_exec_prepare_array() throughout the test to fix this up. While at it, remove some trailing empty lines. Fixes: 9710631cc8f3 ("drm: add drm_exec selftests v4") Signed-off-by: Danilo Krummrich <dakr@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230809225034.8803-1-dakr@redhat.com Signed-off-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm/tests')
-rw-r--r--drivers/gpu/drm/tests/drm_exec_test.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tests/drm_exec_test.c b/drivers/gpu/drm/tests/drm_exec_test.c
index 3610773c22cb..563949d777dd 100644
--- a/drivers/gpu/drm/tests/drm_exec_test.c
+++ b/drivers/gpu/drm/tests/drm_exec_test.c
@@ -125,8 +125,6 @@ static void test_duplicates(struct kunit *test)
drm_exec_fini(&exec);
}
-
-
static void test_prepare(struct kunit *test)
{
struct drm_exec_priv *priv = test->priv;
@@ -145,6 +143,8 @@ static void test_prepare(struct kunit *test)
break;
}
drm_exec_fini(&exec);
+
+ drm_gem_private_object_fini(&gobj);
}
static void test_prepare_array(struct kunit *test)
@@ -165,6 +165,9 @@ static void test_prepare_array(struct kunit *test)
1);
KUNIT_EXPECT_EQ(test, ret, 0);
drm_exec_fini(&exec);
+
+ drm_gem_private_object_fini(&gobj1);
+ drm_gem_private_object_fini(&gobj2);
}
static void test_multiple_loops(struct kunit *test)