Skip to content

Commit

Permalink
[SCSI] libiscsi: flush work before freeing connection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Christie authored and James Bottomley committed Mar 11, 2007
1 parent 62d42a6 commit 779ea12
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 779ea12

Please sign in to comment.