SUNRPC: Fix missing release socket in rpc_sockname()
[ Upstream commit50fa355bc0] 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:2e738fdce2("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
be7d90fc3a
commit
3fbc3c78fa
+1
-1
@@ -1361,7 +1361,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);
|
||||||
|
|||||||
Reference in New Issue
Block a user