From: Enze Li Date: Wed, 6 Sep 2023 14:53:55 +0000 (+0800) Subject: kfence: Defer the assignment of the local variable addr X-Git-Tag: v6.6.7~1942^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec9fee79d48f2f05cb1b95dc901071aa3670f228;p=platform%2Fkernel%2Flinux-starfive.git kfence: Defer the assignment of the local variable addr The LoongArch architecture is different from other architectures. It needs to update __kfence_pool during arch_kfence_init_pool(). This patch modifies the assignment location of the local variable addr in the kfence_init_pool() function to support the case of updating __kfence_pool in arch_kfence_init_pool(). Acked-by: Marco Elver Signed-off-by: Enze Li Signed-off-by: Huacai Chen --- diff --git a/mm/kfence/core.c b/mm/kfence/core.c index dad3c0e..e124fff 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -566,13 +566,14 @@ static void rcu_guarded_free(struct rcu_head *h) */ static unsigned long kfence_init_pool(void) { - unsigned long addr = (unsigned long)__kfence_pool; + unsigned long addr; struct page *pages; int i; if (!arch_kfence_init_pool()) - return addr; + return (unsigned long)__kfence_pool; + addr = (unsigned long)__kfence_pool; pages = virt_to_page(__kfence_pool); /*