Skip to contentSkip to conversation

af_unix: __unix_find_socket_byname() cleanup

PATCH Applied Vito Caputo 2 participants 2 messages Oct 10, 2019 – Oct 12, 2019

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

PATCH 1/1 af_unix: __unix_find_socket_byname() cleanup

Remove pointless return variable dance.

Appears vestigial from when the function did locking as seen in unix_find_socket_byinode(), but locking is handled in unix_find_socket_byname() for __unix_find_socket_byname().

---
 net/unix/af_unix.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
net/unix/af_unix.c +2 -4
index 67e87db5877f..c853ad0875f4 100644
@@ -284,11 +284,9 @@ static struct sock *__unix_find_socket_byname(struct net *net,
 
 		if (u->addr->len == len &&
 		    !memcmp(u->addr->name, sunname, len))
-			goto found;
+			return s;
 	}
-	s = NULL;
-found:
-	return s;
+	return NULL;
 }
 
 static inline struct sock *unix_find_socket_byname(struct net *net,
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw

From: Vito Caputo <[email protected]>
Date: Wed, 9 Oct 2019 20:43:47 -0700

Quoted 7 lines

Remove pointless return variable dance.

Appears vestigial from when the function did locking as seen in unix_find_socket_byinode(), but locking is handled in unix_find_socket_byname() for __unix_find_socket_byname().

I agree with your analysis. :-)

Applied to net-next.