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:
parent
a370ae8556
commit
b5623dede7
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue