]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
af_iucv: avoid left over IUCV connections from failing connects
authorUrsula Braun <ursula.braun@de.ibm.com>
Tue, 6 Jan 2009 02:07:46 +0000 (18:07 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Jan 2009 02:07:46 +0000 (18:07 -0800)
For certain types of AFIUCV socket connect failures IUCV connections
are left over. Add some cleanup-statements to avoid cluttered IUCV
connections.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/iucv/af_iucv.c

index 1077bc4e6e2a1f90076ff59a3943935477631d12..6b5f193e5f48da451cb7a5a5839682aabd2b1a8f 100644 (file)
@@ -521,6 +521,13 @@ static int iucv_sock_connect(struct socket *sock, struct sockaddr *addr,
                release_sock(sk);
                return -ECONNREFUSED;
        }
+
+       if (err) {
+               iucv_path_sever(iucv->path, NULL);
+               iucv_path_free(iucv->path);
+               iucv->path = NULL;
+       }
+
 done:
        release_sock(sk);
        return err;