]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
target/iscsi: Setting to 0 when not previously enabled should be OK
authorAndy Grover <agrover@redhat.com>
Wed, 29 May 2013 19:06:00 +0000 (12:06 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 14 Jun 2013 07:27:46 +0000 (00:27 -0700)
Writing 0 when iser was not previously enabled should succeed but do
nothing.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_configfs.c

index 1c92701c5e92e9f53f14523cdbf19ce265f59d19..fe4a5a20c75c7e80cdaca175be98706a6efe0849 100644 (file)
@@ -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);