afiucv: avoid left over IUCV connections from failing connects
Subsystems (3)
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.
Signed-off-by Ursula Braun <[email protected]>
---
net/iucv/af_iucv.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/iucv/af_iucv.c +7 -0
@@ -540,6 +540,13 @@ static int iucv_sock_connect(struct sockif (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);