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>
This commit is contained in:
Patrick Georgi 2017-01-04 22:22:56 +01:00 committed by Martin Roth
parent a370ae8556
commit b5623dede7
1 changed files with 2 additions and 0 deletions

View File

@ -336,6 +336,8 @@ generic_set_address (hci_t *controller, usb_speed speed,
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));