From: Ursula Braun Date: Tue, 6 Jan 2009 02:07:46 +0000 (-0800) Subject: af_iucv: avoid left over IUCV connections from failing connects X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=18becbc5479f88d5adc218374ca62b8b93ec2545;p=openwrt%2Fstaging%2Fblogic.git af_iucv: avoid left over IUCV connections from failing connects 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 Signed-off-by: David S. Miller --- diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 1077bc4e6e2a..6b5f193e5f48 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -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;