From dadb0901b2f0460f66f48aff75f7759c77c87f68 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 18 Nov 2021 20:43:47 +0800 Subject: [PATCH] mm/damon/core: nullify pointer ctx->kdamond with a NULL mainline inclusion from mainline-5.16 commit 7ec1992b891e59dba0f04e0327980786e8f61b13 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4GVMK CVE: NA ------------------------------------------------- Currently a plain integer is being used to nullify the pointer ctx->kdamond. Use NULL instead. Cleans up sparse warning: mm/damon/core.c:317:40: warning: Using plain integer as NULL pointer Link: https://lkml.kernel.org/r/20210925215908.181226-1-colin.king@canonical.com Signed-off-by: Colin Ian King Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit 7ec1992b891e59dba0f04e0327980786e8f61b13) Signed-off-by: Yue Zou Reviewed-by: Kefeng Wang Signed-off-by: Zheng Zengkai --- mm/damon/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index 8171e7dddc30..d993db50280c 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -314,7 +314,7 @@ static int __damon_start(struct damon_ctx *ctx) nr_running_ctxs); if (IS_ERR(ctx->kdamond)) { err = PTR_ERR(ctx->kdamond); - ctx->kdamond = 0; + ctx->kdamond = NULL; } } mutex_unlock(&ctx->kdamond_lock); -- GitLab