Skip to contentSkip to conversation

afiucv: avoid left over IUCV connections from failing connects

PATCH New Ursula Braun 1 participant 1 message Dec 1, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 afiucv: avoid left over IUCV connections from failing connects

From: Ursula Braun <[email protected]>

For certain types of AFIUCV socket connect failures IUCV connections are left over. Add some cleanup-statements to avoid cluttered IUCV connections.

---

 net/iucv/af_iucv.c |    7 +++++++
 1 file changed, 7 insertions(+)
net/iucv/af_iucv.c +7 -0
Index: net-2.6-uschi/net/iucv/af_iucv.c
===================================================================
@@ -540,6 +540,13 @@ static int iucv_sock_connect(struct sock
 	if (sk->sk_state == IUCV_DISCONN) {
 		err = -ECONNREFUSED;
 	}
+
+	if (err) {
+		iucv_path_sever(iucv->path, NULL);
+		iucv_path_free(iucv->path);
+		iucv->path = NULL;
+	}
+
 done:
 	release_sock(sk);
 	debug_sprintf_event(afiucv_dbf, 6, "connect - end, error %d\n", err);