From 0660c6c1ffb8ff1de04d62432a22b2f0a625fca2 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Wed, 5 Apr 2017 17:33:46 +0200 Subject: [PATCH] inteltool: Fix clean-up and close related TODO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have to call pci_free_dev() for each device we allocated with pci_get_dev(). Since that's not the case for `sb`, we can close this TODO. Change-Id: I1ef80c837263a205467f835156dcb8fa667d3a8f Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/19587 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paul Menzel Reviewed-by: Stefan Reinauer --- util/inteltool/inteltool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/inteltool/inteltool.c b/util/inteltool/inteltool.c index fb24f74793..3f55685993 100644 --- a/util/inteltool/inteltool.c +++ b/util/inteltool/inteltool.c @@ -568,8 +568,12 @@ int main(int argc, char *argv[]) } /* Clean up */ + if (ahci) + pci_free_dev(ahci); + if (gfx) + pci_free_dev(gfx); pci_free_dev(nb); - // pci_free_dev(sb); // TODO: glibc detected "double free or corruption" + /* `sb` wasn't allocated by pci_get_dev() */ pci_cleanup(pacc); return 0;