From 0076118c994250e6850984155bf429c56a14660f Mon Sep 17 00:00:00 2001 From: Andy Grover Date: Wed, 29 May 2013 12:06:00 -0700 Subject: [PATCH] target/iscsi: Setting to 0 when not previously enabled should be OK Writing 0 when iser was not previously enabled should succeed but do nothing. Signed-off-by: Andy Grover Signed-off-by: Nicholas Bellinger --- drivers/target/iscsi/iscsi_target_configfs.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 1c92701c5e92..fe4a5a20c75c 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c @@ -188,14 +188,11 @@ static ssize_t lio_target_np_store_iser( } } else { tpg_np_iser = iscsit_tpg_locate_child_np(tpg_np, ISCSI_INFINIBAND); - if (!tpg_np_iser) { - rc = -EINVAL; - goto out; + if (tpg_np_iser) { + rc = iscsit_tpg_del_network_portal(tpg, tpg_np_iser); + if (rc < 0) + goto out; } - - rc = iscsit_tpg_del_network_portal(tpg, tpg_np_iser); - if (rc < 0) - goto out; } printk("lio_target_np_store_iser() done, op: %d\n", op); -- 2.39.5