From: Mike Christie Date: Wed, 28 Feb 2007 23:32:15 +0000 (-0600) Subject: [SCSI] libiscsi: flush work before freeing connection X-Git-Tag: v2.6.22-rc1~1015^2~80 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=779ea1207b6a43943faa44f41be7311263315604;p=linux-2.6-omap-h63xx.git [SCSI] libiscsi: flush work before freeing connection 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 Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 7c75771c77f..6346a913c36 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -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);