aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2013-08-18 18:07:44 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2013-08-23 23:30:46 -0400
commitc9a03c12464c851e691e8d5b6c9deba779c512e0 (patch)
treeab5ed70802d6888861dbfbd613bbd1c7c67bade5 /drivers/target
parent9d86a2befceb06ee83c1a588915e6d6e0abef797 (diff)
iscsi-target: Fix iscsit_transport reference leak during NP thread reset
This patch fixes a bug in __iscsi_target_login_thread() where an explicit network portal thread reset ends up leaking the iscsit_transport module reference, along with the associated iscsi_conn allocation. This manifests itself with iser-target where a NP reset causes the extra iscsit_transport reference to be taken in iscsit_conn_set_transport() during the reset, which prevents the ib_isert module from being unloaded after the NP thread shutdown has finished. Cc: stable@vger.kernel.org # v3.10+ Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/iscsi/iscsi_target_login.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
index 3402241be87c..bc788c52b6cc 100644
--- a/drivers/target/iscsi/iscsi_target_login.c
+++ b/drivers/target/iscsi/iscsi_target_login.c
@@ -1163,12 +1163,11 @@ static int __iscsi_target_login_thread(struct iscsi_np *np)
1163 if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { 1163 if (np->np_thread_state == ISCSI_NP_THREAD_RESET) {
1164 spin_unlock_bh(&np->np_thread_lock); 1164 spin_unlock_bh(&np->np_thread_lock);
1165 complete(&np->np_restart_comp); 1165 complete(&np->np_restart_comp);
1166 if (ret == -ENODEV) { 1166 iscsit_put_transport(conn->conn_transport);
1167 iscsit_put_transport(conn->conn_transport); 1167 kfree(conn);
1168 kfree(conn); 1168 conn = NULL;
1169 conn = NULL; 1169 if (ret == -ENODEV)
1170 goto out; 1170 goto out;
1171 }
1172 /* Get another socket */ 1171 /* Get another socket */
1173 return 1; 1172 return 1;
1174 } 1173 }