summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2012-11-12 15:35:44 +0100
committerRonald G. Minnich <rminnich@gmail.com>2012-11-14 17:44:15 +0100
commitd633dda995c78f4f2d57d369c1e2baa591c0433a (patch)
tree8151ea728c962406d4f18613ee9a1cd5ec5fb541
parenta482701451391b86b9d48ef5cf2a41f95f421484 (diff)
libpayload: Free usb host controller instance after shutdown
All shutdown() implementations but ehci_shutdown() free the hci_t structure. This seems correct and the reference to the hci_t shouldn't be used after shutdown(), so do it in ehci_shutdown(), too. Change-Id: Ie3506d769e73007735f3211710734a5f0107e43a Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1849 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
-rw-r--r--payloads/libpayload/drivers/usb/ehci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c
index 2ac1480632..4fcd5ea952 100644
--- a/payloads/libpayload/drivers/usb/ehci.c
+++ b/payloads/libpayload/drivers/usb/ehci.c
@@ -101,6 +101,9 @@ static void ehci_shutdown (hci_t *controller)
free(EHCI_INST(controller)->dummy_qh);
EHCI_INST(controller)->operation->configflag = 0;
+
+ free(EHCI_INST(controller));
+ free(controller);
}
enum { EHCI_OUT=0, EHCI_IN=1, EHCI_SETUP=2 };