mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: yahia <yahia.a.abdrabou@gmail.com>
To: sj@kernel.org
Cc: akpm@linux-foundation.org, damon@lists.linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	yahia ahmed <yahia.a.abdrabou@gmail.com>
Subject: [PATCH 1/2] mm/damon/reclaim: fix destruction of ctx
Date: Sat, 20 Jun 2026 02:46:05 +0300	[thread overview]
Message-ID: <20260619234606.221163-2-yahia.a.abdrabou@gmail.com> (raw)
In-Reply-To: <20260619234606.221163-1-yahia.a.abdrabou@gmail.com>

From: yahia ahmed <yahia.a.abdrabou@gmail.com>

Fix the early destruction of ctx if no error was encountered
by returning 0 on success.

Signed-off-by: yahia ahmed <yahia.a.abdrabou@gmail.com>
---
 mm/damon/reclaim.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
index ce4499cf4b8b..15bc06ae7505 100644
--- a/mm/damon/reclaim.c
+++ b/mm/damon/reclaim.c
@@ -268,6 +268,9 @@ static int damon_reclaim_apply_parameters(void)
 	if (err)
 		goto out;
 	err = damon_commit_ctx(ctx, param_ctx);
+
+	if (!err)
+		return 0;
 out:
 	damon_destroy_ctx(param_ctx);
 	return err;
-- 
2.54.0


  reply	other threads:[~2026-06-19 23:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 23:46 [PATCH 0/2] mm/damon/reclaim: fix initalization and parameter issues yahia
2026-06-19 23:46 ` yahia [this message]
2026-06-19 23:46 ` [PATCH 2/2] mm/damon/reclaim: fix potential memory leak yahia
2026-06-20  0:26 ` [PATCH 0/2] mm/damon/reclaim: fix initalization and parameter issues SeongJae Park
2026-06-20  0:35   ` [PATCH v2 0/1] fix initialization " yahia
2026-06-20  0:35     ` [PATCH v2 1/1] mm/damon/reclaim: fix potential memory leak yahia
2026-06-20  3:29       ` [PATCH v3] " yahia
2026-06-20 16:40         ` SeongJae Park
2026-06-20 16:50           ` [PATCH v1] " yahia
2026-06-20 17:09             ` SeongJae Park
2026-06-20 17:20               ` yahia

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=20260619234606.221163-2-yahia.a.abdrabou@gmail.com \
    --to=yahia.a.abdrabou@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sj@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®