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@secunet.com> Reviewed-on: http://review.coreboot.org/6245 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
parent
8b8e96370d
commit
f4316f8c10
|
@ -312,9 +312,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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue