[SCSI] iscsi bugfixes: fix oops when removing session
authorMike Christie <michaelc@cs.wisc.edu>
Mon, 24 Jul 2006 20:47:29 +0000 (15:47 -0500)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Fri, 28 Jul 2006 16:49:01 +0000 (11:49 -0500)
We are touching the cls_session after we have freed
it. This causes a oops.

Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/libiscsi.c

index 36f520b9260e487b2df728548cc61fd3f27f23fa..c989bc6180b3bb46ed2727ef36870027b26305a0 100644 (file)
@@ -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 iscsi_session *session = iscsi_hostdata(shost->hostdata);
+       struct module *owner = cls_session->transport->owner;
 
        scsi_remove_host(shost);
 
@@ -1345,7 +1346,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
 
        iscsi_destroy_session(cls_session);
        scsi_host_put(shost);
-       module_put(cls_session->transport->owner);
+       module_put(owner);
 }
 EXPORT_SYMBOL_GPL(iscsi_session_teardown);