ACK: [PATCH] lib: fwts_acpi_tables: unmap mem, fixes memory leak
ivanhu
ivan.hu at canonical.com
Wed Aug 23 07:15:34 UTC 2017
On 08/22/2017 11:08 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> I forgot to unmap mem before returning from the function, causing a
> memory leak. Fix this by unmapping it.
>
> Fixes: f327fcea6f81 ("lib: fwts_acpi_tables: re-work fwts_acpi_get_rsdp, less memory copies")
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/src/fwts_acpi_tables.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index 9b2312e5..3c3a63a1 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -162,6 +162,7 @@ static fwts_acpi_table_rsdp *fwts_acpi_get_rsdp(fwts_framework *fw, void *addr,
> fwts_log_error(fw, "Cannot safely copy RSDP from address %p.", mem);
> goto err;
> }
> + (void)fwts_munmap(mem, sizeof(fwts_acpi_table_rsdp));
>
> /* Determine original RSDP size from revision. */
> *rsdp_len = (rsdp->revision < 1) ? 20 : 36;
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list