Skip to content

Commit

Permalink
SUNRPC: Fix missing release socket in rpc_sockname()
Browse files Browse the repository at this point in the history
[ Upstream commit 50fa355 ]

socket dynamically created is not released when getting an unintended
address family type in rpc_sockname(), direct to out_release for calling
sock_release().

Fixes: 2e738fd ("SUNRPC: Add API to acquire source address")
Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Wang ShaoBo authored and gregkh committed Dec 31, 2022
1 parent 79d4cd4 commit 7055c87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sunrpc/clnt.c
Expand Up @@ -1375,7 +1375,7 @@ static int rpc_sockname(struct net *net, struct sockaddr *sap, size_t salen,
break;
default:
err = -EAFNOSUPPORT;
goto out;
goto out_release;
}
if (err < 0) {
dprintk("RPC: can't bind UDP socket (%d)\n", err);
Expand Down

0 comments on commit 7055c87

Please sign in to comment.