浏览代码

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

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 年前
父节点
当前提交
2ace5196e5
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7
    0
      src/drivers/block/ibft.c

+ 7
- 0
src/drivers/block/ibft.c 查看文件

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
 }

正在加载...
取消
保存