Skip to contentSkip to conversation

SUNRPC: Fix missing release socket in rpc_sockname()

PATCH New Wang ShaoBo 1 participant 1 message Nov 24, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 2e738fdce22f ("SUNRPC: Add API to acquire source address")
---
 net/sunrpc/clnt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/clnt.c +1 -1
index 993acf38af87..0b0b9f1eed46 100644
@@ -1442,7 +1442,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);
Signature · 1 line
2.25.1