WSL2-Linux-Kernel/net/9p
Wang Hai 8782b32ef8 net/9p: Fix a potential socket leak in p9_socket_open
[ Upstream commit dcc14cfd7d ]

Both p9_fd_create_tcp() and p9_fd_create_unix() will call
p9_socket_open(). If the creation of p9_trans_fd fails,
p9_fd_create_tcp() and p9_fd_create_unix() will return an
error directly instead of releasing the cscoket, which will
result in a socket leak.

This patch adds sock_release() to fix the leak issue.

Fixes: 6b18662e23 ("9p connect fixes")
Signed-off-by: Wang Hai <wanghai38@huawei.com>
ACKed-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-08 11:28:41 +01:00
..
Kconfig net: remove redundant 'depends on NET' 2021-01-27 17:04:12 -08:00
Makefile 9p: Remove p9_idpool 2018-08-29 13:39:57 +09:00
client.c net/9p: Initialize the iounit field during fid creation 2022-08-17 14:24:23 +02:00
error.c 9p: fix a bunch of checkpatch warnings 2022-08-17 14:24:07 +02:00
mod.c 9p: fix a bunch of checkpatch warnings 2022-08-17 14:24:07 +02:00
protocol.c 9p: fix a bunch of checkpatch warnings 2022-08-17 14:24:07 +02:00
protocol.h 9p: fix a bunch of checkpatch warnings 2022-08-17 14:24:07 +02:00
trans_common.c net: 9p: Fix kerneldoc warnings of missing parameters etc 2020-11-02 12:25:52 -08:00
trans_common.h 9p: fix a bunch of checkpatch warnings 2022-08-17 14:24:07 +02:00
trans_fd.c net/9p: Fix a potential socket leak in p9_socket_open 2022-12-08 11:28:41 +01:00
trans_rdma.c 9p: Add client parameter to p9_req_put() 2022-08-17 14:24:07 +02:00
trans_virtio.c 9p: Add client parameter to p9_req_put() 2022-08-17 14:24:07 +02:00
trans_xen.c 9p: Add client parameter to p9_req_put() 2022-08-17 14:24:07 +02:00