powerpc/boot: Handle allocation failure in simple_realloc()
authorLi zeming <zeming@nfschina.com>
Mon, 19 Dec 2022 02:18:16 +0000 (10:18 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Mar 2024 11:20:28 +0000 (22:20 +1100)
commit69b0194ccec033c208b071e019032c1919c2822d
tree14fba095c0f54995f1506b338b4568bf532402aa
parentcda9c0d556283e2d4adaa9960b2dc19b16156bae
powerpc/boot: Handle allocation failure in simple_realloc()

simple_malloc() will return NULL when there is not enough memory left.
Check pointer 'new' before using it to copy the old data.

Signed-off-by: Li zeming <zeming@nfschina.com>
[mpe: Reword subject, use change log from Christophe]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20221219021816.3012-1-zeming@nfschina.com
arch/powerpc/boot/simple_alloc.c