coreboot-kgpe-d16/tests/lib
Patrick Georgi c59426f60d malloc/memalign: Return NULL if the request is too large
It's what this function family is defined to do, we currently don't
usually run into the case (see: not too many die() instances going
around), it's more useful to try to recover, and the JPEG parser can run
into it if the work buffer size exceeds the remaining heap, whereas its
sole user (the bootsplash code) knows what to do when seeing a NULL.

Use xmalloc() if you want an allocation that either works or dies.

tl;dr: That code path isn't usually taken. Right now it crashes. With
this patch it _might_ survive. There is a use-case for doing it like
that now.

Change-Id: I262fbad7daae0ca3aab583fda00665a2592deaa8
Signed-off-by: Patrick Georgi <patrick@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80226
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2024-01-29 19:12:43 +00:00
..
b64_decode-test.c
bootmem-test.c
cbfs-lookup-test.c
cbfs-verification-test.c cbfs/vboot: Adapt to new vb2_digest API 2022-09-02 23:51:29 +00:00
cbmem_console-test.c
cbmem_stage_cache-test.c
compute_ip_checksum-test.c
coreboot_table-test.c coreboot_tables: Make existing alignment conventions more explicit 2022-12-22 15:34:28 +00:00
crc_byte-test.c
dimm_info_util-test.c spd.h: Move enum ddr3_module_type to ddr3.h 2023-01-04 12:39:32 +00:00
edid-test.c
fmap-test.c
hexstrtobin-test.c
imd-test.c
imd_cbmem-test.c Allow to build romstage sources inside the bootblock 2023-11-09 13:20:18 +00:00
lib-test.c
libgcc-test.c
list-test.c
lzma-test.c
Makefile.mk tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00
malloc-test.c malloc/memalign: Return NULL if the request is too large 2024-01-29 19:12:43 +00:00
memchr-test.c
memcmp-test.c
memcpy-test.c
memmove-test.c
memrange-test.c allocator_v4: Introduce RESOURCE_ALLOCATION_TOP_DOWN 2022-09-04 16:35:22 +00:00
memset-test.c
region_file-test.c
rtc-test.c tree: Drop repeated words 2023-02-07 04:37:31 +00:00
spd_cache-test.c test/lib: Add non-existent DIMMs test case in spd_cache-test 2022-11-03 13:00:15 +00:00
stack-test.c
string-test.c
timestamp-test.c
uuid-test.c
ux_locales-test.c tests/lib: Add unit tests for ux_locales_get_text() 2023-08-30 15:20:59 +00:00