Files
u-boot-krane/common
Igor OpaniukandMattijs Korpershoek f9c750ea30 avb: free mmc_part allocated by get_partition()
get_partition() returns a malloc()'d struct mmc_part and only frees it on
its own internal error path. None of its callers - mmc_byte_io(),
get_unique_guid_for_partition() and get_size_of_partition() - free the
returned pointer, so every partition access leaks one struct mmc_part.
A single "avb verify" issues many such accesses (footer, vbmeta and the
hashed image chunks), so the leak accumulates quickly.

Free the descriptor in all three callers. mmc_byte_io() is reworked to
use a single exit path so the partition is released on every return.

Fixes: 3af30e4443 ("avb2.0: implement AVB ops")
Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Link: https://patch.msgid.link/20260712-avb-fix-memory-leaks-v1-2-51d6d5a42631@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2026-07-24 14:43:24 +02:00
..
2026-04-22 14:23:49 -06:00
2026-05-15 19:28:29 +08:00
2026-04-22 14:23:49 -06:00
2026-06-25 14:13:36 -06:00
2026-04-17 08:02:42 +02:00
2026-05-12 15:38:00 -06:00