Skip to content

Commit

Permalink
Merge branch 'master' into ab-locks-02
Browse files Browse the repository at this point in the history
Conflicts:
	tempesta_fw/sock_clnt.c
  • Loading branch information
keshonok committed Sep 15, 2015
2 parents 985838e + d2ea1a8 commit d567ff8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tempesta_fw/sock_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,22 @@ tfw_sock_clnt_new(struct sock *sk)
if (!cli) {
TFW_ERR("can't obtain a client for the new socket\n");
r = -ENOENT;
goto err_cli_obtain;
goto err_classify;
}

conn = tfw_cli_conn_alloc();
if (!conn) {
TFW_ERR("can't allocate a new client connection\n");
r = -ENOMEM;
goto err_conn_alloc;
goto err_client;
}

ss_proto_inherit(listen_sock_proto, &conn->proto, Conn_Clnt);

r = tfw_connection_new(conn);
if (r) {
TFW_ERR("conn_init() hook returned error\n");
goto err_conn_init;
goto err_conn;
}

/* Link Tempesta with the socket and the peer. */
Expand All @@ -141,19 +141,18 @@ tfw_sock_clnt_new(struct sock *sk)
sk, conn, cli);
return 0;

err_conn_init:
err_conn:
tfw_connection_destruct(conn);
/*
* We have just created the connection and did not link anything
* to it yet. There's no need to play with conn->refcnt. We can
* just free @conn unconditionally.
*/
tfw_cli_conn_free(conn);
err_conn_alloc:
err_client:
tfw_client_put(cli);
err_cli_obtain:
tfw_classify_conn_close(sk);
err_classify:
tfw_classify_conn_close(sk);
return r;
}

Expand Down

0 comments on commit d567ff8

Please sign in to comment.