commit | b5623dede7569cf74dd865748d17b0e413c03ee2 | [log] [tgz] |
---|---|---|
author | Patrick Georgi <pgeorgi@chromium.org> | Wed Jan 04 22:22:56 2017 +0100 |
committer | Martin Roth <martinroth@google.com> | Fri Jan 06 18:43:05 2017 +0100 |
tree | 21592fd00fcdb509d3143afe0ab67c26dc3d9efe | |
parent | a370ae855627364694c089e9a69a98fc837bfb0f [diff] [blame] |
libpayload: usb: handle situation with no free device address Change-Id: I1308bdca90f1a09d980f384ee85552198a39b965 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1260940 Reviewed-on: https://review.coreboot.org/18036 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c index bfb697d..bb42f89 100644 --- a/payloads/libpayload/drivers/usb/usb.c +++ b/payloads/libpayload/drivers/usb/usb.c
@@ -336,6 +336,8 @@ int hubport, int hubaddr) { int adr = get_free_address (controller); // address to set + if (adr < 0) + return NULL; dev_req_t dr; memset (&dr, 0, sizeof (dr));