linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <Usama.Anjum@collabora.com>
To: zhangjiao2 <zhangjiao2@cmss.chinamobile.com>, akpm@linux-foundation.org
Cc: Usama.Anjum@collabora.com, shuah@kernel.org, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/mm: Add missing free.
Date: Fri, 27 Sep 2024 12:25:07 +0500	[thread overview]
Message-ID: <87b06c82-5e59-404b-889d-baa1293bd160@collabora.com> (raw)
In-Reply-To: <20240927030114.3792-1-zhangjiao2@cmss.chinamobile.com>

On 9/27/24 8:01 AM, zhangjiao2 wrote:
> 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>
Please find the first patch which missed this free() and add fixes-by tag.

> ---
>  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;
>  	}
>  

-- 
BR,
Muhammad Usama Anjum



  reply	other threads:[~2024-09-27  7:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-27  3:01 zhangjiao2
2024-09-27  7:25 ` Muhammad Usama Anjum [this message]
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=87b06c82-5e59-404b-889d-baa1293bd160@collabora.com \
    --to=usama.anjum@collabora.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 \
    --cc=zhangjiao2@cmss.chinamobile.com \
    /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