[SCSI] iscsi class: fix refcount leak
authorMike Christie <michaelc@cs.wisc.edu>
Mon, 16 Jun 2008 15:11:32 +0000 (10:11 -0500)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Sat, 12 Jul 2008 13:22:29 +0000 (08:22 -0500)
Must do a module_out if the endpoint lookup fails.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/scsi_transport_iscsi.c

index 9fd5c6d87ed1016eadf3a230123415105b2f5c12..bc0f74d4ea09f547ebbac93cac6aa7123cef85a3 100644 (file)
@@ -1422,8 +1422,10 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                break;
        case ISCSI_UEVENT_CREATE_BOUND_SESSION:
                ep = iscsi_lookup_endpoint(ev->u.c_bound_session.ep_handle);
-               if (!ep)
-                       return -EINVAL;
+               if (!ep) {
+                       err = -EINVAL;
+                       break;
+               }
 
                err = iscsi_if_create_session(priv, ep, ev,
                                        ev->u.c_bound_session.initial_cmdsn,