Skip to content

Commit

Permalink
dlm: fix double-release of socket in error exit path
Browse files Browse the repository at this point in the history
The last correction to the tcp_connect_to_sock error exit path,
commit a89d63a, can free an already
freed socket, due to collision with a previous (incomplete) attempt
to fix the same issue, commit 311f6fc.

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
Casey Dahlin authored and David Teigland committed Aug 18, 2009
1 parent df4ecf1 commit b5711b8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,10 +926,8 @@ 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)) {
sock_release(sock);
if (dlm_nodeid_to_addr(con->nodeid, &saddr))
goto out_err;
}

sock->sk->sk_user_data = con;
con->rx_action = receive_from_sock;
Expand Down

0 comments on commit b5711b8

Please sign in to comment.