[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240927030114.3792-1-zhangjiao2@cmss.chinamobile.com>
Date: Fri, 27 Sep 2024 11:01:14 +0800
From: zhangjiao2 <zhangjiao2@...s.chinamobile.com>
To: akpm@...ux-foundation.org
Cc: shuah@...nel.org,
linux-mm@...ck.org,
linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org,
zhang jiao <zhangjiao2@...s.chinamobile.com>
Subject: [PATCH] selftests/mm: Add missing free.
From: zhang jiao <zhangjiao2@...s.chinamobile.com>
There is a memory leak in mkdirty, just free src before return.
Signed-off-by: zhang jiao <zhangjiao2@...s.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
Powered by blists - more mailing lists