All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] net: tipc: fix possible refcount leak in tipc_sk_create()
@ 2022-06-29  6:34 Hangyu Hua
  2022-06-29  9:52 ` Tung Quang Nguyen
  2022-06-29 13:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Hangyu Hua @ 2022-06-29  6:34 UTC (permalink / raw)
  To: jmaloy, ying.xue, davem, edumazet, kuba, pabeni, tung.q.nguyen
  Cc: netdev, tipc-discussion, linux-kernel, Hangyu Hua

Free sk in case tipc_sk_insert() fails.

Signed-off-by: Hangyu Hua <hbh25y@gmail.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH v2] net: tipc: fix possible refcount leak in tipc_sk_create()
  2022-06-29  6:34 [PATCH v2] net: tipc: fix possible refcount leak in tipc_sk_create() Hangyu Hua
@ 2022-06-29  9:52 ` Tung Quang Nguyen
  2022-06-29 13:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Tung Quang Nguyen @ 2022-06-29  9:52 UTC (permalink / raw)
  To: Hangyu Hua
  Cc: netdev, tipc-discussion, linux-kernel, jmaloy, ying.xue, davem,
	edumazet, kuba, pabeni

> 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@gmail.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@dektech.com.au>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] net: tipc: fix possible refcount leak in tipc_sk_create()
  2022-06-29  6:34 [PATCH v2] net: tipc: fix possible refcount leak in tipc_sk_create() Hangyu Hua
  2022-06-29  9:52 ` Tung Quang Nguyen
@ 2022-06-29 13:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-29 13:00 UTC (permalink / raw)
  To: Hangyu Hua
  Cc: jmaloy, ying.xue, davem, edumazet, kuba, pabeni, tung.q.nguyen,
	netdev, tipc-discussion, linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Wed, 29 Jun 2022 14:34:18 +0800 you wrote:
> Free sk in case tipc_sk_insert() fails.
> 
> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
> ---
> 
> v2: use a succinct commit log.
> 
> [...]

Here is the summary with links:
  - [v2] net: tipc: fix possible refcount leak in tipc_sk_create()
    https://git.kernel.org/netdev/net/c/00aff3590fc0

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-29 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29  6:34 [PATCH v2] net: tipc: fix possible refcount leak in tipc_sk_create() Hangyu Hua
2022-06-29  9:52 ` Tung Quang Nguyen
2022-06-29 13:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.