Commit 65dbd7c2 authored by Hendrik Brueckner's avatar Hendrik Brueckner Committed by David S. Miller

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: default avatarHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18becbc5
...@@ -1042,12 +1042,14 @@ static int iucv_callback_connreq(struct iucv_path *path, ...@@ -1042,12 +1042,14 @@ static int iucv_callback_connreq(struct iucv_path *path,
ASCEBC(user_data, sizeof(user_data)); ASCEBC(user_data, sizeof(user_data));
if (sk->sk_state != IUCV_LISTEN) { if (sk->sk_state != IUCV_LISTEN) {
err = iucv_path_sever(path, user_data); err = iucv_path_sever(path, user_data);
iucv_path_free(path);
goto fail; goto fail;
} }
/* Check for backlog size */ /* Check for backlog size */
if (sk_acceptq_is_full(sk)) { if (sk_acceptq_is_full(sk)) {
err = iucv_path_sever(path, user_data); err = iucv_path_sever(path, user_data);
iucv_path_free(path);
goto fail; goto fail;
} }
...@@ -1055,6 +1057,7 @@ static int iucv_callback_connreq(struct iucv_path *path, ...@@ -1055,6 +1057,7 @@ static int iucv_callback_connreq(struct iucv_path *path,
nsk = iucv_sock_alloc(NULL, SOCK_STREAM, GFP_ATOMIC); nsk = iucv_sock_alloc(NULL, SOCK_STREAM, GFP_ATOMIC);
if (!nsk) { if (!nsk) {
err = iucv_path_sever(path, user_data); err = iucv_path_sever(path, user_data);
iucv_path_free(path);
goto fail; goto fail;
} }
...@@ -1078,6 +1081,8 @@ static int iucv_callback_connreq(struct iucv_path *path, ...@@ -1078,6 +1081,8 @@ static int iucv_callback_connreq(struct iucv_path *path,
err = iucv_path_accept(path, &af_iucv_handler, nuser_data, nsk); err = iucv_path_accept(path, &af_iucv_handler, nuser_data, nsk);
if (err) { if (err) {
err = iucv_path_sever(path, user_data); err = iucv_path_sever(path, user_data);
iucv_path_free(path);
iucv_sock_kill(nsk);
goto fail; goto fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment