]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[iscsi] Do not install iBFT when no iSCSI targets exist
authorMichael Brown <mcb30@ipxe.org>
Tue, 28 Mar 2017 17:45:23 +0000 (20:45 +0300)
committerMichael Brown <mcb30@ipxe.org>
Tue, 28 Mar 2017 17:45:23 +0000 (20:45 +0300)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/block/ibft.c

index a9d21f9acc13b1bb9d43c135489bf7981bcb1704..bb7812b3b096190fa669fee7920a0523bd07654f 100644 (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;
 }