From 18becbc5479f88d5adc218374ca62b8b93ec2545 Mon Sep 17 00:00:00 2001 From: Ursula Braun Date: Mon, 5 Jan 2009 18:07:46 -0800 Subject: [PATCH] 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 --- net/iucv/af_iucv.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- 2.30.2