summaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi/iscsi_target.c
diff options
context:
space:
mode:
authorNicholas Bellinger2013-12-12 00:45:32 +0100
committerNicholas Bellinger2013-12-19 09:18:25 +0100
commitdb6077fd0b7dd41dc6ff18329cec979379071f87 (patch)
tree7491659574ec90fa70a41fa3401aadc8ab55e3cb /drivers/target/iscsi/iscsi_target.c
parentqla2xxx: Fix schedule_delayed_work() for target timeout calculations (diff)
downloadkernel-qcow2-linux-db6077fd0b7dd41dc6ff18329cec979379071f87.tar.gz
kernel-qcow2-linux-db6077fd0b7dd41dc6ff18329cec979379071f87.tar.xz
kernel-qcow2-linux-db6077fd0b7dd41dc6ff18329cec979379071f87.zip
iscsi-target: Fix incorrect np->np_thread NULL assignment
When shutting down a target there is a race condition between iscsit_del_np() and __iscsi_target_login_thread(). The latter sets the thread pointer to NULL, and the former tries to issue kthread_stop() on that pointer without any synchronization. This patch moves the np->np_thread NULL assignment into iscsit_del_np(), after kthread_stop() has completed. It also removes the signal_pending() + np_state check, and only exits when kthread_should_stop() is true. Reported-by: Hannes Reinecke <hare@suse.de> Cc: <stable@vger.kernel.org> #3.12+ Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target.c')
-rw-r--r--drivers/target/iscsi/iscsi_target.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 02182ab017b1..00867190413c 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -465,6 +465,7 @@ int iscsit_del_np(struct iscsi_np *np)
*/
send_sig(SIGINT, np->np_thread, 1);
kthread_stop(np->np_thread);
+ np->np_thread = NULL;
}
np->np_transport->iscsit_free_np(np);