[PATCH 1/2] mm/damon/reclaim: fix destruction of ctx
From: yahia
Date: Fri Jun 19 2026 - 19:47:10 EST
From: yahia ahmed <yahia.a.abdrabou@xxxxxxxxx>
Fix the early destruction of ctx if no error was encountered
by returning 0 on success.
Signed-off-by: yahia ahmed <yahia.a.abdrabou@xxxxxxxxx>
---
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