]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
samples/damon/prcl: avoid starting DAMON before initialization
authorSeongJae Park <sj@kernel.org>
Tue, 9 Sep 2025 02:22:37 +0000 (19:22 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Sep 2025 00:23:40 +0000 (17:23 -0700)
Commit 2780505ec2b4 ("samples/damon/prcl: fix boot time enable crash") is
somehow incompletely applying the origin patch [1].  It is missing the
part that avoids starting DAMON before module initialization.  Probably a
mistake during a merge has happened.  Fix it by applying the missed part
again.

Link: https://lkml.kernel.org/r/20250909022238.2989-3-sj@kernel.org
Link: https://lore.kernel.org/20250706193207.39810-3-sj@kernel.org
Fixes: 2780505ec2b4 ("samples/damon/prcl: fix boot time enable crash")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
samples/damon/prcl.c

index 1b839c06a612f2d91ad0f8da78a8c19e40a02616..0226652f94d55e6f7f3cf63fac536e4473a19558 100644 (file)
@@ -137,6 +137,9 @@ static int damon_sample_prcl_enable_store(
        if (enabled == is_enabled)
                return 0;
 
+       if (!init_called)
+               return 0;
+
        if (enabled) {
                err = damon_sample_prcl_start();
                if (err)