Skip to content

Commit

Permalink
dlm: release socket on error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Masatake YAMATO authored and David Teigland committed Jul 14, 2008
1 parent 329fc4c commit 311f6fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 311f6fc

Please sign in to comment.