[SCSI] libiscsi: flush work before freeing connection
authorMike Christie <michaelc@cs.wisc.edu>
Wed, 28 Feb 2007 23:32:15 +0000 (17:32 -0600)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Sun, 11 Mar 2007 16:24:12 +0000 (11:24 -0500)
It's possible that we call iscsi_xmitworker after iscsi_conn_release
which causes a oops. This patch flushes the workqueue.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/libiscsi.c

index 7c75771c77ff4aa32559b0cfeab48626fe65d47e..6346a913c36e368c9a8df19332629810b3dba418 100644 (file)
@@ -1597,6 +1597,9 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
                wake_up(&conn->ehwait);
        }
 
+       /* flush queued up work because we free the connection below */
+       scsi_flush_work(session->host);
+
        spin_lock_bh(&session->lock);
        kfree(conn->data);
        kfree(conn->persistent_address);