Skip to content

Commit ec9fee7

Browse files
lienzechenhuacai
authored andcommitted
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 <elver@google.com> Signed-off-by: Enze Li <lienze@kylinos.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 2363088 commit ec9fee7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mm/kfence/core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,13 +566,14 @@ static void rcu_guarded_free(struct rcu_head *h)
566566
*/
567567
static unsigned long kfence_init_pool(void)
568568
{
569-
unsigned long addr = (unsigned long)__kfence_pool;
569+
unsigned long addr;
570570
struct page *pages;
571571
int i;
572572

573573
if (!arch_kfence_init_pool())
574-
return addr;
574+
return (unsigned long)__kfence_pool;
575575

576+
addr = (unsigned long)__kfence_pool;
576577
pages = virt_to_page(__kfence_pool);
577578

578579
/*

0 commit comments

Comments
 (0)