[coreboot] New patch to review for coreboot: 4c2ae46 libpayload: Free usb host controller instance after shutdown

Nico Huber (nico.huber@secunet.com) gerrit at coreboot.org
Wed Nov 14 10:04:15 CET 2012

Nico Huber (nico.huber at secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1849


commit 4c2ae4657fcf30f1bed3d526c8794d93f4a0da64
Author: Nico Huber <nico.huber at secunet.com>
Date:   Mon Nov 12 15:35:44 2012 +0100

    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 at secunet.com>
 payloads/libpayload/drivers/usb/ehci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c
index 2ac1480..4fcd5ea 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)
 	EHCI_INST(controller)->operation->configflag = 0;
+	free(EHCI_INST(controller));
+	free(controller);
 enum { EHCI_OUT=0, EHCI_IN=1, EHCI_SETUP=2 };

More information about the coreboot mailing list