History log of /linux-master/arch/powerpc/boot/simple_alloc.c
Revision Date Author Comments
# f2d5bcca 29-Feb-2024 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Only free if realloc() succeeds

simple_realloc() frees the original buffer (ptr) even if the
reallocation failed.

Fix it to behave like standard realloc() and only free the original
buffer if the reallocation succeeded.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240229115149.749264-1-mpe@ellerman.id.au


# 69b0194c 18-Dec-2022 Li zeming <zeming@nfschina.com>

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


# e01432ba 19-Aug-2022 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Convert more files to use SPDX tags

These files are all plain GPL 2.0, with a second sentence about being
licensed as-is.

Similar to the rule in commit 577b61cee5b2 ("treewide: Replace GPLv2
boilerplate/reference with SPDX - gpl-2.0_398.RULE").

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20220819110430.433984-1-mpe@ellerman.id.au


# 4ca478e6 18-Apr-2007 Geert Uytterhoeven <Geert.Uytterhoeven@eu.sony.com>

[POWERPC] bootwrapper: Use `unsigned long' for malloc sizes

Use `unsigned long' for malloc sizes, to match common practice and types used
by most callers and callees.
Also use `unsigned long' for integers representing pointers in simple_alloc.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@eu.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 01a63720 16-Oct-2006 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Add simple memory allocator to bootwrapper

Provide primitive malloc, free, and realloc functions for bootwrapper.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>