powerpc/kasan: Fix error detection on memory allocation
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 19 May 2020 05:48:43 +0000 (05:48 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 20 May 2020 13:41:01 +0000 (23:41 +1000)
commitd132443a73d7a131775df46f33000f67ed92de1e
tree454c60479119fd5aa6197dd0d2a6d0a45316d625
parent30df74d67d48949da87e3a5b57c381763e8fd526
powerpc/kasan: Fix error detection on memory allocation

In case (k_start & PAGE_MASK) doesn't equal (kstart), 'va' will never be
NULL allthough 'block' is NULL

Check the return of memblock_alloc() directly instead of
the resulting address in the loop.

Fixes: 509cd3f2b473 ("powerpc/32: Simplify KASAN init")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/7cb8ca82042bfc45a5cfe726c921cd7e7eeb12a3.1589866984.git.christophe.leroy@csgroup.eu
arch/powerpc/mm/kasan/kasan_init_32.c