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
 	strings.len = 0;
591
 	strings.len = 0;
592
 	len = offset;
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
 	/* Allocate table */
600
 	/* Allocate table */
595
 	data = zalloc ( len );
601
 	data = zalloc ( len );
596
 	if ( ! data ) {
602
 	if ( ! data ) {
668
  err_initiator:
674
  err_initiator:
669
 	free ( data );
675
 	free ( data );
670
  err_alloc:
676
  err_alloc:
677
+ no_targets:
671
 	free ( strings.data );
678
 	free ( strings.data );
672
 	return rc;
679
 	return rc;
673
 }
680
 }

Loading…
Cancel
Save