iscsi_target: Remove redundant null check before kfree
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 21 Nov 2012 10:44:40 +0000 (16:14 +0530)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 28 Nov 2012 06:49:20 +0000 (22:49 -0800)
kfree on null pointer is a no-op.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_login.c

index 7bf9ccc..fdb632f 100644 (file)
@@ -1118,10 +1118,8 @@ new_sess_out:
                idr_remove(&sess_idr, conn->sess->session_index);
                spin_unlock_bh(&sess_idr_lock);
        }
-       if (conn->sess->sess_ops)
-               kfree(conn->sess->sess_ops);
-       if (conn->sess)
-               kfree(conn->sess);
+       kfree(conn->sess->sess_ops);
+       kfree(conn->sess);
 old_sess_out:
        iscsi_stop_login_thread_timer(np);
        /*