Files
linux/tools/testing/shared
Liam R. Howlett (Google) c9ed137890 tools/testing/shared: catch a failed posix_memalign()
posix_memalign() returns zero or a positive error number and never sets
errno, so the checks for a negative return in kmem_cache_alloc_lru() and
kmem_cache_alloc_bulk() is not possible.  A failed aligned allocation
carries on with the pointer unset, into the constructor or the memset().

Test for any non-zero return.

Link: https://lore.kernel.org/[email protected]
Fixes: 8801c35c36 ("tools: fix -Wunused-result in linux.c")
Signed-off-by: Liam R. Howlett (Google) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Reviewed-by: Lorenzo Stoakes (ARM) <[email protected]>
Reviewed-by: Vishal Moola (Fractile) <[email protected]>
Reviewed-by: SJ Park <[email protected]>
Cc: Matthew Wilcox (Oracle) <[email protected]>
Cc: Vlastimil Babka <[email protected]>
2026-10-24 01:56:42 -07:00
..
…