Fred Reitberger has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/75645?usp=email )
Change subject: libpayload/drivers/usb/xhci.c: Check for NULL in xhci_init ......................................................................
libpayload/drivers/usb/xhci.c: Check for NULL in xhci_init
Ensure the physical_bar parameter passed to xhci_init is not NULL, else return NULL.
Change-Id: I05c32612606793adcba3f4a5724092387a215d41 Signed-off-by: Fred Reitberger reitbergerfred@gmail.com --- M payloads/libpayload/drivers/usb/xhci.c 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/75645/1
diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c index 6737a14..e9a7ead 100644 --- a/payloads/libpayload/drivers/usb/xhci.c +++ b/payloads/libpayload/drivers/usb/xhci.c @@ -155,6 +155,9 @@ { int i;
+ if (!physical_bar) + goto _exit_xhci; + /* First, allocate and initialize static controller structures */
hci_t *const controller = new_controller(); @@ -301,6 +304,7 @@ /* _free_controller: */ detach_controller(controller); free(controller); +_exit_xhci: return NULL; }