[coreboot-gerrit] New patch to review for coreboot: 44881d6 libpayload: Catch null-pointer dereference in xHCI

Nico Huber (nico.h@gmx.de) gerrit at coreboot.org
Thu Jul 10 10:22:09 CEST 2014


Nico Huber (nico.h at gmx.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6245

-gerrit

commit 44881d67a9e25b1a95f2d43487ddf4daf5e8ac67
Author: Nico Huber <nico.huber at secunet.com>
Date:   Mon Jul 7 17:11:53 2014 +0200

    libpayload: Catch null-pointer dereference in xHCI
    
    Fix a possible null-pointer dereference (hopefully) before anyone runs
    into this. Also don't switch ports to xHCI if initialization failed.
    
    Change-Id: I5dbaeb435a98ead0b50d27fde13c9f1433ea3e81
    Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
 payloads/libpayload/drivers/usb/xhci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c
index f540230..1455734 100644
--- a/payloads/libpayload/drivers/usb/xhci.c
+++ b/payloads/libpayload/drivers/usb/xhci.c
@@ -311,9 +311,11 @@ xhci_pci_init (pcidev_t addr)
 	}
 
 	controller = xhci_init((unsigned long)reg_addr);
-	controller->pcidev = addr;
+	if (controller) {
+		controller->pcidev = addr;
 
-	xhci_switch_ppt_ports(addr);
+		xhci_switch_ppt_ports(addr);
+	}
 
 	return controller;
 }



More information about the coreboot-gerrit mailing list