dlm: release socket on error
authorMasatake YAMATO <yamato@redhat.com>
Fri, 27 Jun 2008 13:35:03 +0000 (08:35 -0500)
committerDavid Teigland <teigland@redhat.com>
Mon, 14 Jul 2008 18:56:59 +0000 (13:56 -0500)
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>
fs/dlm/lowcomms.c

index 637018c891eff7110620ba3aff2ff9f5e573ec8d..3962262f991a32a415db104fd191679834c537a9 100644 (file)
@@ -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;