diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index d29d549275..971b5e5114 100644 --- a/mm/kasan/kasan.c +++ b/mm/kasan/kasan.c @@ -233,6 +233,11 @@ static void kasan_set_poison(FAR const void *addr, size_t size, uintptr_t mask; int flags; + if (size == 0) + { + return; + } + flags = spin_lock_irqsave(&g_lock); p = kasan_mem_to_shadow(addr, size, &bit);