diff options
author | Masatake YAMATO <yamato@redhat.com> | 2008-06-27 15:35:03 +0200 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2008-07-14 20:56:59 +0200 |
commit | 311f6fc77c51926dbdfbeab0a5d88d70f01fa3f4 (patch) | |
tree | bb5c3ca66a104642ac97814509015e60e5aea7d3 /fs | |
parent | dlm: fix basts for granted CW waiting PR/CW (diff) | |
download | linux-311f6fc77c51926dbdfbeab0a5d88d70f01fa3f4.tar.xz linux-311f6fc77c51926dbdfbeab0a5d88d70f01fa3f4.zip |
dlm: release socket on error
It seems that `sock' allocated by sock_create_kern in
tcp_connect_to_sock() of dlm/fs/lowcomms.c is not released if
dlm_nodeid_to_addr an error.
Acked-by: Christine Caulfield <ccaulfie@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dlm/lowcomms.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 637018c891ef..3962262f991a 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -891,8 +891,10 @@ static void tcp_connect_to_sock(struct connection *con) goto out_err; memset(&saddr, 0, sizeof(saddr)); - if (dlm_nodeid_to_addr(con->nodeid, &saddr)) + if (dlm_nodeid_to_addr(con->nodeid, &saddr)) { + sock_release(sock); goto out_err; + } sock->sk->sk_user_data = con; con->rx_action = receive_from_sock; |