From 67be24906feb6efecce70cd5bfdc2ba8f06d3d5b Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Fri, 14 Mar 2025 12:57:02 +0200 Subject: lmb: change the return code on lmb_alloc_addr() Ben reports a failure to boot the kernel on hardware that starts its physical memory from 0x0. The reason is that lmb_alloc_addr(), which is supposed to reserve a specific address, takes the address as the first argument, but then also returns the address for success or failure and treats 0 as a failure. Since we already know the address change the prototype to return an int. Reported-by: Ben Schneider Signed-off-by: Ilias Apalodimas Tested-by: Ben Schneider Reviewed-by: Sughosh Ganu --- fs/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/fs.c b/fs/fs.c index 99ddcc5e37b..1ed7c0f2d2c 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -554,7 +554,7 @@ static int fs_read_lmb_check(const char *filename, ulong addr, loff_t offset, lmb_dump_all(); - if (lmb_alloc_addr(addr, read_len, LMB_NONE) == addr) + if (!lmb_alloc_addr(addr, read_len, LMB_NONE)) return 0; log_err("** Reading file would overwrite reserved memory **\n"); -- cgit v1.2.3