mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
efi_loader: memory leak efi_add_memory_map_pg
Don't leak newlist if we error out.
Fixes: 74c16acce3
("efi_loader: Don't allocate from memory holes")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
parent
257a498fbb
commit
ecae4bbf35
1 changed files with 2 additions and 0 deletions
|
@ -324,6 +324,7 @@ static efi_status_t efi_add_memory_map_pg(u64 start, u64 pages,
|
||||||
* The user requested to only have RAM overlaps,
|
* The user requested to only have RAM overlaps,
|
||||||
* but we hit a non-RAM region. Error out.
|
* but we hit a non-RAM region. Error out.
|
||||||
*/
|
*/
|
||||||
|
free(newlist);
|
||||||
return EFI_NO_MAPPING;
|
return EFI_NO_MAPPING;
|
||||||
case EFI_CARVE_NO_OVERLAP:
|
case EFI_CARVE_NO_OVERLAP:
|
||||||
/* Just ignore this list entry */
|
/* Just ignore this list entry */
|
||||||
|
@ -354,6 +355,7 @@ static efi_status_t efi_add_memory_map_pg(u64 start, u64 pages,
|
||||||
* The payload wanted to have RAM overlaps, but we overlapped
|
* The payload wanted to have RAM overlaps, but we overlapped
|
||||||
* with an unallocated region. Error out.
|
* with an unallocated region. Error out.
|
||||||
*/
|
*/
|
||||||
|
free(newlist);
|
||||||
return EFI_NO_MAPPING;
|
return EFI_NO_MAPPING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue