Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[iscsi] Do not install iBFT when no iSCSI targets exist
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 28, 2017
1 parent 7cfdd76 commit 2ace519
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/drivers/block/ibft.c
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 2ace519

Please sign in to comment.