From: Andy Grover Date: Wed, 29 May 2013 19:06:00 +0000 (-0700) Subject: target/iscsi: Setting to 0 when not previously enabled should be OK X-Git-Tag: next-20130617~71^2~10 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0076118c994250e6850984155bf429c56a14660f;p=karo-tx-linux.git 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 --- 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);