From: "Christian König" <christian.koenig@amd.com>
To: Danilo Krummrich <dakr@redhat.com>,
airlied@gmail.com, daniel@ffwll.ch, alexander.deucher@amd.com,
arthurgrillo@riseup.net
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH drm-misc-next] drm/test: drm_exec: fix memory leak on object prepare
Date: Thu, 10 Aug 2023 09:03:16 +0200 [thread overview]
Message-ID: <37a235d0-3da1-85c3-766d-29fd31d8a797@amd.com> (raw)
In-Reply-To: <20230809225034.8803-1-dakr@redhat.com>
Am 10.08.23 um 00:50 schrieb Danilo Krummrich:
> 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 and pushed to drm-misc-next.
Thanks,
Christian.
> ---
> drivers/gpu/drm/tests/drm_exec_test.c | 7 +++++--
> 1 file 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 f79c9f0359aa..9ccf0dd9ca89 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 struct kunit_case drm_exec_tests[] = {
>
> base-commit: e05f3938c5a7896d09736e3381675a57ffee7a0a
prev parent reply other threads:[~2023-08-10 7:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 22:50 Danilo Krummrich
2023-08-10 7:03 ` Christian König [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=37a235d0-3da1-85c3-766d-29fd31d8a797@amd.com \
--to=christian.koenig@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=arthurgrillo@riseup.net \
--cc=dakr@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®