damon_call() failure was causing the context to be stopped, but asynchronously by the kdamond thread. To handle the race, the caller had to stop the context. damon_call() is updated to do the stop on its own. Remove the damon_stop() call from the damon_call() error handling. Signed-off-by: SJ Park --- samples/damon/prcl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/samples/damon/prcl.c b/samples/damon/prcl.c index edeae145c4a8a..842099bd62286 100644 --- a/samples/damon/prcl.c +++ b/samples/damon/prcl.c @@ -113,10 +113,8 @@ static int damon_sample_prcl_start(void) repeat_call_control.data = ctx; err = damon_call(ctx, &repeat_call_control); - if (err) { - damon_stop(&ctx, 1); + if (err) damon_destroy_ctx(ctx); - } return err; } -- 2.47.3