Browse Source

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

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 years ago
parent
commit
2ace5196e5
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      src/drivers/block/ibft.c

+ 7
- 0
src/drivers/block/ibft.c View File

@@ -591,6 +591,12 @@ static int ibft_install ( int ( * install ) ( struct acpi_header *acpi ) ) {
591 591
 	strings.len = 0;
592 592
 	len = offset;
593 593
 
594
+	/* Do nothing if no targets exist */
595
+	if ( ! targets ) {
596
+		rc = 0;
597
+		goto no_targets;
598
+	}
599
+
594 600
 	/* Allocate table */
595 601
 	data = zalloc ( len );
596 602
 	if ( ! data ) {
@@ -668,6 +674,7 @@ static int ibft_install ( int ( * install ) ( struct acpi_header *acpi ) ) {
668 674
  err_initiator:
669 675
 	free ( data );
670 676
  err_alloc:
677
+ no_targets:
671 678
 	free ( strings.data );
672 679
 	return rc;
673 680
 }

Loading…
Cancel
Save