From: Sughosh Ganu Date: Mon, 3 Mar 2025 13:32:28 +0000 (+0530) Subject: lmb: check for a region's coalescing with all existing regions X-Git-Tag: v2025.07-rc1~18^2~30^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e4df5886d27cff043561c8087f373e26cfe9f34;p=pandora-u-boot.git lmb: check for a region's coalescing with all existing regions The lmb_add_region_flags() first checks if the new region to be added can be coalesced with existing regions. The check stops if the two regions are adjecent but their flags do not match. However, it is possible that the newly added region might be adjacent with the next existing region and with matching flags. Check for this possibility by not breaking out of the loop. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt --- diff --git a/lib/lmb.c b/lib/lmb.c index 26d9cafef41..53af96fa2a9 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -190,7 +190,7 @@ static long lmb_add_region_flags(struct alist *lmb_rgn_lst, phys_addr_t base, break; } else if (ret < 0) { if (flags != rgnflags) - break; + continue; rgn[i].size += size; coalesced++; break;