summaryrefslogtreecommitdiffstats
path: root/src/drivers/block
diff options
context:
space:
mode:
authorMichael Brown2017-03-28 19:45:23 +0200
committerMichael Brown2017-03-28 19:45:23 +0200
commit2ace5196e5580810ea3aa53352a4a7331f442e58 (patch)
tree0f7aaa1189454f6413e62b30d8aebc0f8fd4bc7f /src/drivers/block
parent[block] Describe all SAN devices via ACPI tables (diff)
downloadipxe-2ace5196e5580810ea3aa53352a4a7331f442e58.tar.gz
ipxe-2ace5196e5580810ea3aa53352a4a7331f442e58.tar.xz
ipxe-2ace5196e5580810ea3aa53352a4a7331f442e58.zip
[iscsi] Do not install iBFT when no iSCSI targets exist
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/block')
-rw-r--r--src/drivers/block/ibft.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/drivers/block/ibft.c b/src/drivers/block/ibft.c
index a9d21f9a..bb7812b3 100644
--- a/src/drivers/block/ibft.c
+++ b/src/drivers/block/ibft.c
@@ -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;
}