summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJonas Karlman <[email protected]>2026-08-11 23:16:47 +0000
committerTom Rini <[email protected]>2026-08-24 13:58:00 -0600
commit93e5e5f4cbefccab206a79f86e98c2c39a9d2440 (patch)
tree44dac0cdfdb578d25f27c8c8ba2adac7f7ab6239 /include
parent6073c36b2c8d39afe3ecc789b281667a3ddebc70 (diff)
lmb: Return -EFAULT when requested region is not part of memory map
lmb_alloc_addr() is documented to return -EINVAL when the requested memory region is not part of the LMB memory map. However, -EINVAL is also used to e.g. indicate that a NULL pointer is passed as the addr parameter or when the requested memory region partially overlaps an existing region. Change lmb_alloc_addr() to return -EFAULT when the requested memory region is not part of the LMB memory map to make the type of error known to callers. Also extend unit tests to validate that the return code has stay the same when the requested memory region partially overlaps. No caller of lmb_alloc_addr() is checking what type of error code is returned, so this change has no intended behavior change. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Randolph Sapp <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/lmb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/lmb.h b/include/lmb.h
index ed472e9ef2e..028dabb19e8 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -124,7 +124,7 @@ struct lmb {
* Return: 0 on success, -ve value on failure
*
* When the allocation is of type @LMB_MEM_ALLOC_ADDR, the return value can
- * be -EINVAL if the requested memory region is not part of the LMB memory
+ * be -EFAULT if the requested memory region is not part of the LMB memory
* map, and -EEXIST if the requested region is already allocated.
*/
int lmb_alloc_mem(enum lmb_mem_type type, u64 align, phys_addr_t *addr,