Skip to content

Commit

Permalink
iscsi_target: Remove redundant null check before kfree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sachin Kamat authored and Nicholas Bellinger committed Nov 28, 2012
1 parent 3a41d85 commit b07c28a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/target/iscsi/iscsi_target_login.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,10 +1118,8 @@ static int __iscsi_target_login_thread(struct iscsi_np *np)
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);
/*
Expand Down

0 comments on commit b07c28a

Please sign in to comment.