From d633dda995c78f4f2d57d369c1e2baa591c0433a Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Mon, 12 Nov 2012 15:35:44 +0100 Subject: 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 Reviewed-on: http://review.coreboot.org/1849 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- payloads/libpayload/drivers/usb/ehci.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'payloads/libpayload') 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 }; -- cgit v1.2.3