Commit 50fa355b authored by Wang ShaoBo's avatar Wang ShaoBo Committed by Trond Myklebust

SUNRPC: Fix missing release socket in rpc_sockname()

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: 2e738fdc ("SUNRPC: Add API to acquire source address")
Signed-off-by: default avatarWang ShaoBo <bobo.shaobowang@huawei.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 9181f40f
...@@ -1442,7 +1442,7 @@ static int rpc_sockname(struct net *net, struct sockaddr *sap, size_t salen, ...@@ -1442,7 +1442,7 @@ static int rpc_sockname(struct net *net, struct sockaddr *sap, size_t salen,
break; break;
default: default:
err = -EAFNOSUPPORT; err = -EAFNOSUPPORT;
goto out; goto out_release;
} }
if (err < 0) { if (err < 0) {
dprintk("RPC: can't bind UDP socket (%d)\n", err); dprintk("RPC: can't bind UDP socket (%d)\n", err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment