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 <yahia.a.abdrabou@gmail.com>
Subject: [PATCH v2 1/1] mm/damon/reclaim: fix potential memory leak
Date: Sat, 20 Jun 2026 03:35:57 +0300 [thread overview]
Message-ID: <20260620003557.243313-2-yahia.a.abdrabou@gmail.com> (raw)
In-Reply-To: <20260620003557.243313-1-yahia.a.abdrabou@gmail.com>
Signed-off-by: yahia <yahia.a.abdrabou@gmail.com>
---
mm/damon/reclaim.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
index ce4499cf4b8b..6601b08996c6 100644
--- a/mm/damon/reclaim.c
+++ b/mm/damon/reclaim.c
@@ -478,6 +478,11 @@ static int __init damon_reclaim_init(void)
out:
if (err && enabled)
enabled = false;
+
+ if (err && ctx) {
+ damon_destroy_ctx(ctx);
+ ctx = NULL;
+ }
return err;
}
--
2.54.0
next prev parent reply other threads:[~2026-06-20 0:36 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 ` [PATCH 1/2] mm/damon/reclaim: fix destruction of ctx yahia
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 ` yahia [this message]
2026-06-20 3:29 ` [PATCH v3] mm/damon/reclaim: fix potential memory leak 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=20260620003557.243313-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®