|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [Qemu-devel] [PATCH] tests/ide: Free pcibus when finishing a test |
Date: | Tue, 13 Nov 2018 17:34:01 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
On 13/11/18 16:11, Thomas Huth wrote:
Once a test has finished, the pcibus structure should be freed, to avoid leaking memory and to make sure that the structure is properly re-initialized when the next test starts. Signed-off-by: Thomas Huth <address@hidden> --- tests/ide-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ide-test.c b/tests/ide-test.c index 33cef61..f0280e6 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -142,6 +142,10 @@ static void ide_test_start(const char *cmdline_fmt, ...)static void ide_test_quit(void){ + if (pcibus) {
This check would be cleaner in qpci_free_pc().
+ qpci_free_pc(pcibus); + pcibus = NULL;
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
+ } pc_alloc_uninit(guest_malloc); guest_malloc = NULL; qtest_end();
[Prev in Thread] | Current Thread | [Next in Thread] |