[PATCH v2 11/11] test: boot: imagemap: caller-owned region not resized

Tom Rini trini at konsulko.com
Fri Oct 30 10:59:06 PDT 2026


On Wed, Oct 21, 2026 at 03:10:12PM +0100, Daniel Golle wrote:

> Add a unit test that locks down the fix in imagemap_map(): a larger
> request against a region recorded by imagemap_map_to() (which the
> caller owns and is not LMB-reserved) falls through to a fresh LMB
> allocation instead of resizing the caller's memory.
> 
> The test reserves a caller-owned buffer inside the LMB-managed RAM,
> records a 64-byte region there via imagemap_map_to() with a guard
> pattern beyond the payload, then issues a 256-byte imagemap_map() at the
> same base. It verifies the returned pointer differs from the caller's
> buffer, the guard tail is unchanged, and the new region is LMB-reserved.
> 
> Signed-off-by: Daniel Golle <daniel at makrotopia.org>

This fails CI:
test/boot/imagemap.c: In function 'imagemap_test_map_to_not_resized':
test/boot/imagemap.c:375:11: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  375 |         r = alist_get(&priv->regions, 0, struct imagemap_region);
      |           ^

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20261030/50a58856/attachment.sig>


More information about the openwrt-devel mailing list