[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB9PR05MB90784623C9C6206C3C44980288BB9@DB9PR05MB9078.eurprd05.prod.outlook.com>
Date: Wed, 29 Jun 2022 09:52:45 +0000
From: Tung Quang Nguyen <tung.q.nguyen@...tech.com.au>
To: Hangyu Hua <hbh25y@...il.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"tipc-discussion@...ts.sourceforge.net"
<tipc-discussion@...ts.sourceforge.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"jmaloy@...hat.com" <jmaloy@...hat.com>,
"ying.xue@...driver.com" <ying.xue@...driver.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>
Subject: RE: [PATCH v2] net: tipc: fix possible refcount leak in
tipc_sk_create()
> Subject: [PATCH v2] net: tipc: fix possible refcount leak in tipc_sk_create()
>
> Free sk in case tipc_sk_insert() fails.
>
> Signed-off-by: Hangyu Hua <hbh25y@...il.com>
> ---
>
> v2: use a succinct commit log.
>
> net/tipc/socket.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/tipc/socket.c b/net/tipc/socket.c
> index 17f8c523e33b..43509c7e90fc 100644
> --- a/net/tipc/socket.c
> +++ b/net/tipc/socket.c
> @@ -502,6 +502,7 @@ static int tipc_sk_create(struct net *net, struct socket *sock,
> sock_init_data(sock, sk);
> tipc_set_sk_state(sk, TIPC_OPEN);
> if (tipc_sk_insert(tsk)) {
> + sk_free(sk);
> pr_warn("Socket create failed; port number exhausted\n");
> return -EINVAL;
> }
> --
> 2.25.1
Reviewed-by: Tung Nguyen <tung.q.nguyen@...tech.com.au>
Powered by blists - more mailing lists