From: Nicholas Bellinger Date: Wed, 11 Dec 2013 23:45:32 +0000 (-0800) Subject: iscsi-target: Fix incorrect np->np_thread NULL assignment X-Git-Tag: v3.13-rc5~3^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db6077fd0b7dd41dc6ff18329cec979379071f87;p=pandora-kernel.git 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 Cc: #3.12+ Signed-off-by: Nicholas Bellinger --- Reading git-diff-tree failed