mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
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]>