From: zhangjiao2 <zhangjiao2@cmss.chinamobile.com>
To: akpm@linux-foundation.org
Cc: shuah@kernel.org, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
zhang jiao <zhangjiao2@cmss.chinamobile.com>
Subject: [PATCH] selftests/mm: Add missing free.
Date: Fri, 27 Sep 2024 11:01:14 +0800 [thread overview]
Message-ID: <20240927030114.3792-1-zhangjiao2@cmss.chinamobile.com> (raw)
From: zhang jiao <zhangjiao2@cmss.chinamobile.com>
There is a memory leak in mkdirty, just free src before return.
Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
---
tools/testing/selftests/mm/mkdirty.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/mm/mkdirty.c b/tools/testing/selftests/mm/mkdirty.c
index 1db134063c38..af2fce496912 100644
--- a/tools/testing/selftests/mm/mkdirty.c
+++ b/tools/testing/selftests/mm/mkdirty.c
@@ -280,6 +280,7 @@ static void test_uffdio_copy(void)
dst = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE|MAP_ANON, -1, 0);
if (dst == MAP_FAILED) {
ksft_test_result_fail("mmap() failed\n");
+ free(src);
return;
}
--
2.33.0
next reply other threads:[~2024-09-27 3:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 3:01 zhangjiao2 [this message]
2024-09-27 7:25 ` Muhammad Usama Anjum
2024-09-27 12:23 ` David Hildenbrand
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=20240927030114.3792-1-zhangjiao2@cmss.chinamobile.com \
--to=zhangjiao2@cmss.chinamobile.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shuah@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