aboutsummaryrefslogtreecommitdiffstats
path: root/net/iucv
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2009-01-05 21:08:23 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-05 21:08:23 -0500
commit65dbd7c2778f1921ef1ee2a73e47a2a126fed30f (patch)
tree12b6b4517fcc202fe1246c2c87e540cf135fa2d4 /net/iucv
parent18becbc5479f88d5adc218374ca62b8b93ec2545 (diff)
af_iucv: Free iucv path/socket in path_pending callback
Free iucv path after iucv_path_sever() calls in iucv_callback_connreq() (path_pending() iucv callback). If iucv_path_accept() fails, free path and free/kill newly created socket. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/iucv')
-rw-r--r--net/iucv/af_iucv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 6b5f193e5f48..eb8a2a0b6eb7 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -1042,12 +1042,14 @@ static int iucv_callback_connreq(struct iucv_path *path,
1042 ASCEBC(user_data, sizeof(user_data)); 1042 ASCEBC(user_data, sizeof(user_data));
1043 if (sk->sk_state != IUCV_LISTEN) { 1043 if (sk->sk_state != IUCV_LISTEN) {
1044 err = iucv_path_sever(path, user_data); 1044 err = iucv_path_sever(path, user_data);
1045 iucv_path_free(path);
1045 goto fail; 1046 goto fail;
1046 } 1047 }
1047 1048
1048 /* Check for backlog size */ 1049 /* Check for backlog size */
1049 if (sk_acceptq_is_full(sk)) { 1050 if (sk_acceptq_is_full(sk)) {
1050 err = iucv_path_sever(path, user_data); 1051 err = iucv_path_sever(path, user_data);
1052 iucv_path_free(path);
1051 goto fail; 1053 goto fail;
1052 } 1054 }
1053 1055
@@ -1055,6 +1057,7 @@ static int iucv_callback_connreq(struct iucv_path *path,
1055 nsk = iucv_sock_alloc(NULL, SOCK_STREAM, GFP_ATOMIC); 1057 nsk = iucv_sock_alloc(NULL, SOCK_STREAM, GFP_ATOMIC);
1056 if (!nsk) { 1058 if (!nsk) {
1057 err = iucv_path_sever(path, user_data); 1059 err = iucv_path_sever(path, user_data);
1060 iucv_path_free(path);
1058 goto fail; 1061 goto fail;
1059 } 1062 }
1060 1063
@@ -1078,6 +1081,8 @@ static int iucv_callback_connreq(struct iucv_path *path,
1078 err = iucv_path_accept(path, &af_iucv_handler, nuser_data, nsk); 1081 err = iucv_path_accept(path, &af_iucv_handler, nuser_data, nsk);
1079 if (err) { 1082 if (err) {
1080 err = iucv_path_sever(path, user_data); 1083 err = iucv_path_sever(path, user_data);
1084 iucv_path_free(path);
1085 iucv_sock_kill(nsk);
1081 goto fail; 1086 goto fail;
1082 } 1087 }
1083 1088