david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[iscsi] Do not install iBFT when no iSCSI targets exist

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2017-03-28 20:45:23 +03:00
parent 7cfdd769aa
commit 2ace5196e5
1 changed files with 7 additions and 0 deletions

View File

@ -591,6 +591,12 @@ static int ibft_install ( int ( * install ) ( struct acpi_header *acpi ) ) {
strings.len = 0;
len = offset;
/* Do nothing if no targets exist */
if ( ! targets ) {
rc = 0;
goto no_targets;
}
/* Allocate table */
data = zalloc ( len );
if ( ! data ) {
@ -668,6 +674,7 @@ static int ibft_install ( int ( * install ) ( struct acpi_header *acpi ) ) {
err_initiator:
free ( data );
err_alloc:
no_targets:
free ( strings.data );
return rc;
}