Commit 63f75cc8 authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[SCSI] iscsi bugfixes: fix oops when removing session

We are touching the cls_session after we have freed
it. This causes a oops.
Signed-off-by: default avatarOr Gerlitz  <ogerlitz@voltaire.com>
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 1c83469d
...@@ -1337,6 +1337,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) ...@@ -1337,6 +1337,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
{ {
struct Scsi_Host *shost = iscsi_session_to_shost(cls_session); struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
struct iscsi_session *session = iscsi_hostdata(shost->hostdata); struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
struct module *owner = cls_session->transport->owner;
scsi_remove_host(shost); scsi_remove_host(shost);
...@@ -1345,7 +1346,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) ...@@ -1345,7 +1346,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
iscsi_destroy_session(cls_session); iscsi_destroy_session(cls_session);
scsi_host_put(shost); scsi_host_put(shost);
module_put(cls_session->transport->owner); module_put(owner);
} }
EXPORT_SYMBOL_GPL(iscsi_session_teardown); EXPORT_SYMBOL_GPL(iscsi_session_teardown);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment