[PATCH v2 19/21] treewide: add checks for the return value of memblock_alloc*()

Max Filippov jcmvbkbc at gmail.com
Fri Feb 1 02:23:02 AEDT 2019


On Mon, Jan 21, 2019 at 12:06 AM Mike Rapoport <rppt at linux.ibm.com> wrote:
>
> Add check for the return value of memblock_alloc*() functions and call
> panic() in case of error.
> The panic message repeats the one used by panicing memblock allocators with
> adjustment of parameters to include only relevant ones.
>
> The replacement was mostly automated with semantic patches like the one
> below with manual massaging of format strings.
>
> @@
> expression ptr, size, align;
> @@
> ptr = memblock_alloc(size, align);
> + if (!ptr)
> +       panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__,
> size, align);
>
> Signed-off-by: Mike Rapoport <rppt at linux.ibm.com>
> Reviewed-by: Guo Ren <ren_guo at c-sky.com>             # c-sky
> Acked-by: Paul Burton <paul.burton at mips.com>         # MIPS
> Acked-by: Heiko Carstens <heiko.carstens at de.ibm.com> # s390
> Reviewed-by: Juergen Gross <jgross at suse.com>         # Xen
> ---
>  arch/xtensa/mm/kasan_init.c               |  4 ++++
>  arch/xtensa/mm/mmu.c                      |  3 +++

For xtensa:
Acked-by: Max Filippov <jcmvbkbc at gmail.com>

-- 
Thanks.
-- Max


More information about the Linuxppc-dev mailing list