From: Masatake YAMATO Date: Fri, 27 Jun 2008 13:35:03 +0000 (-0500) Subject: dlm: release socket on error X-Git-Tag: v2.6.27-rc1~26^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=311f6fc77c51926dbdfbeab0a5d88d70f01fa3f4;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Masatake YAMATO Signed-off-by: David Teigland --- diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 637018c891e..3962262f991 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;