U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Simon Glass <sjg@chromium.org>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>,
	Patrick Rudolph <patrick.rudolph@9elements.com>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v5 44/46] test: acpi: Correct memory leaks
Date: Fri, 21 Mar 2025 12:34:43 +0100	[thread overview]
Message-ID: <9e22e439-cd75-4046-b2b6-33b545f091dd@gmx.de> (raw)
In-Reply-To: <20250315142643.2600605-45-sjg@chromium.org>

On 15.03.25 15:26, Simon Glass wrote:
> Free the memory used in tests to avoid a leak. Also unmap the addresses
> for sandbox.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> ---
>
> (no changes since v3)
>
> Changes in v3:
> - Add new patch to correct memory leaks in the ACPI test
>
>   test/dm/acpi.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/test/dm/acpi.c b/test/dm/acpi.c
> index 39a26bbb492..f98f9d1e74b 100644
> --- a/test/dm/acpi.c
> +++ b/test/dm/acpi.c
> @@ -309,6 +309,8 @@ static int dm_test_acpi_write_tables(struct unit_test_state *uts)
>   	}
>   	ut_asserteq(0, ctx.rsdt->entry[3]);
>   	ut_asserteq(0, ctx.xsdt->entry[3]);
> +	unmap_sysmem(buf);
> +	free(buf);
>
>   	return 0;
>   }
> @@ -386,6 +388,8 @@ static int dm_test_acpi_ctx_and_base_tables(struct unit_test_state *uts)
>
>   	ut_asserteq(nomap_to_sysmem(rsdt), rsdp->rsdt_address);
>   	ut_asserteq(nomap_to_sysmem(xsdt), rsdp->xsdt_address);
> +	unmap_sysmem(buf);
> +	free(buf);
>
>   	return 0;
>   }
> @@ -428,6 +432,8 @@ static int dm_test_acpi_cmd_list(struct unit_test_state *uts)
>   	ut_assert_nextline("DMAR  %16lx  %5zx  v01 U-BOOT U-BOOTBL %x INTL 0",
>   			   addr, sizeof(struct acpi_dmar), OEM_REVISION);
>   	ut_assert_console_end();
> +	unmap_sysmem(buf);
> +	free(buf);
>
>   	return 0;
>   }
> @@ -458,6 +464,8 @@ static int dm_test_acpi_cmd_dump(struct unit_test_state *uts)
>   	ut_assert_nextline("DMAR @ %16lx", addr);
>   	ut_assert_nextlines_are_dump(0x30);
>   	ut_assert_console_end();
> +	unmap_sysmem(buf);
> +	free(buf);
>
>   	return 0;
>   }
> @@ -642,6 +650,8 @@ static int dm_test_acpi_cmd_items(struct unit_test_state *uts)
>   	ut_assert_nextlines_are_dump(2);
>   	ut_assert_nextline("%s", "");
>   	ut_assert_console_end();
> +	unmap_sysmem(buf);
> +	free(buf);
>
>   	return 0;
>   }
> @@ -679,6 +689,8 @@ static int dm_test_acpi_cmd_set(struct unit_test_state *uts)
>   	ut_asserteq(addr, gd_acpi_start());
>
>   	ut_assert_console_end();
> +	unmap_sysmem(buf);
> +	free(buf);
>
>   	return 0;
>   }
> @@ -774,6 +786,7 @@ static int dm_test_acpi_find_table(struct unit_test_state *uts)
>
>   	/* Restore previous ACPI tables */
>   	gd_set_acpi_start(acpi_start);
> +	unmap_sysmem(buf);
>   	free(buf);
>
>   	return 0;


  reply	other threads:[~2025-03-21 11:34 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-15 14:25 [PATCH v5 00/46] x86: Improve operation under QEMU Simon Glass
2025-03-15 14:25 ` [PATCH v5 01/46] boot: Correct ramdisk address Simon Glass
2025-03-15 14:25 ` [PATCH v5 02/46] sandbox: Correct a typo in mapmem Simon Glass
2025-03-15 14:25 ` [PATCH v5 03/46] x86: Expand x86_64 early memory Simon Glass
2025-03-15 14:25 ` [PATCH v5 04/46] x86: qemu: Switch to bochs display Simon Glass
2025-03-15 14:25 ` [PATCH v5 05/46] x86: qemu: Enable dhrystone Simon Glass
2025-03-15 14:25 ` [PATCH v5 06/46] x86: qemu: Avoid accessing BSS too early Simon Glass
2025-03-15 14:25 ` [PATCH v5 07/46] x86: Drop mpspec from the SPL build Simon Glass
2025-03-17 14:31   ` Tom Rini
2025-03-18  8:32     ` Simon Glass
2025-03-15 14:25 ` [PATCH v5 08/46] x86: Add some log categories Simon Glass
2025-03-15 14:25 ` [PATCH v5 09/46] x86: Drop use of CONFIG_REALMODE_DEBUG Simon Glass
2025-03-17 14:32   ` Tom Rini
2025-03-15 14:25 ` [PATCH v5 10/46] x86: Avoid clearing the VESA display Simon Glass
2025-03-15 14:25 ` [PATCH v5 11/46] x86: Add 64-bit entries to the GDT Simon Glass
2025-03-15 14:25 ` [PATCH v5 12/46] x86: Use defines for the cache flags Simon Glass
2025-03-15 14:25 ` [PATCH v5 13/46] x86: spl: Drop duplicate CPU init Simon Glass
2025-03-15 14:25 ` [PATCH v5 14/46] x86: Drop the message about features missing in 64-bit Simon Glass
2025-03-15 14:25 ` [PATCH v5 15/46] x86: Include stdbool.h in interrupt header Simon Glass
2025-03-15 14:25 ` [PATCH v5 16/46] x86: Tidy up the GDT size in start/16.S Simon Glass
2025-03-15 14:25 ` [PATCH v5 17/46] x86: Disable paging before changing to long mode Simon Glass
2025-03-15 14:25 ` [PATCH v5 18/46] x86: Use the same GDT when jumping " Simon Glass
2025-03-15 14:25 ` [PATCH v5 19/46] x86: Use a simple jump into " Simon Glass
2025-03-15 14:25 ` [PATCH v5 20/46] x86: Rename the _D dirty flag Simon Glass
2025-03-15 14:25 ` [PATCH v5 21/46] x86: Support CPU functions in long mode Simon Glass
2025-03-15 14:25 ` [PATCH v5 22/46] x86: Add functions to convert between mtrr size and mask Simon Glass
2025-03-15 14:25 ` [PATCH v5 23/46] x86: Update mtrr command to support 64-bit values Simon Glass
2025-03-15 14:25 ` [PATCH v5 24/46] x86: Update cpuid_eax et al to work on amd64 Simon Glass
2025-03-15 14:25 ` [PATCH v5 25/46] x86: Correct msr operation " Simon Glass
2025-03-15 14:25 ` [PATCH v5 26/46] x86: Allow adding non-aligned size for MTRR Simon Glass
2025-03-15 14:25 ` [PATCH v5 27/46] x86: emulation: Set an MTRR for the RAM Simon Glass
2025-03-15 14:25 ` [PATCH v5 28/46] x86: qemu: Support environment and cat command Simon Glass
2025-03-15 14:25 ` [PATCH v5 29/46] test/py: Correct sizing of created disks Simon Glass
2025-03-15 14:25 ` [PATCH v5 30/46] test/py: Add a helper to send characters Simon Glass
2025-03-15 14:25 ` [PATCH v5 31/46] test/py: Allow tests to be filtered by role Simon Glass
2025-03-15 14:25 ` [PATCH v5 32/46] x86: e820: Add a function to dump the e820 table Simon Glass
2025-03-15 14:25 ` [PATCH v5 33/46] x86: Add a new API for e820 Simon Glass
2025-03-15 14:25 ` [PATCH v5 34/46] x86: qemu: Use the new e820 API Simon Glass
2025-03-15 14:25 ` [PATCH v5 35/46] x86: emulation: Support BLOBLIST_TABLES properly Simon Glass
2025-03-15 14:25 ` [PATCH v5 36/46] x86: Support a 64-bit ramdisk address Simon Glass
2025-03-15 14:25 ` [PATCH v5 37/46] acpi: Mark struct acpi_rsdp as packed Simon Glass
2025-03-15 14:25 ` [PATCH v5 38/46] boot: Consider non-bootable partitions Simon Glass
2025-03-18 14:04   ` Tom Rini
2025-03-18 15:24     ` Simon Glass
2025-03-18 15:52       ` Tom Rini
2025-03-19 15:03         ` Simon Glass
2025-03-19 15:40           ` Tom Rini
2025-03-20  3:43             ` Simon Glass
2025-03-20 14:22               ` Tom Rini
2025-03-21 18:38                 ` Simon Glass
2025-03-28 16:29                   ` Tom Rini
2025-03-28 23:41                     ` Simon Glass
2025-04-02 14:28   ` Tom Rini
2025-04-02 19:22     ` Simon Glass
2025-04-03 17:43       ` Tom Rini
2025-03-15 14:25 ` [PATCH v5 39/46] boot: Handle running out of labels Simon Glass
2025-03-15 14:26 ` [PATCH v5 40/46] boot: Support IO UARTs for earlycon and console Simon Glass
2025-04-02 14:28   ` Tom Rini
2025-04-02 19:22     ` Simon Glass
2025-04-02 19:50       ` Tom Rini
2025-04-02 19:56         ` Tom Rini
2025-04-02 23:54           ` Simon Glass
2025-04-03  0:26             ` Tom Rini
2025-04-03 17:57               ` Simon Glass
2025-03-15 14:26 ` [PATCH v5 41/46] sandbox: acpi: Avoid a warning about FADT Simon Glass
2025-03-15 14:26 ` [PATCH v5 42/46] sandbox: acpi: Correct mapping in FADT Simon Glass
2025-03-15 14:26 ` [PATCH v5 43/46] acpi: Add a checksum to the DMAR table Simon Glass
2025-03-21 11:47   ` Heinrich Schuchardt
2025-03-15 14:26 ` [PATCH v5 44/46] test: acpi: Correct memory leaks Simon Glass
2025-03-21 11:34   ` Heinrich Schuchardt [this message]
2025-03-15 14:26 ` [PATCH v5 45/46] acpi: Support checking checksums Simon Glass
2025-03-21 10:49   ` Heinrich Schuchardt
2025-03-21 12:24     ` Heinrich Schuchardt
2025-03-28 12:01       ` Simon Glass
2025-03-15 14:26 ` [PATCH v5 46/46] test: Add a test for booting Ubuntu 24.04 Simon Glass
2025-04-05 14:31 ` [PATCH v5 00/46] x86: Improve operation under QEMU Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e22e439-cd75-4046-b2b6-33b545f091dd@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=bmeng.cn@gmail.com \
    --cc=patrick.rudolph@9elements.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox