OSDN Git Service

af_unix: __unix_find_socket_byname() cleanup
authorVito Caputo <vcaputo@pengaru.com>
Thu, 10 Oct 2019 03:43:47 +0000 (20:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 12 Oct 2019 03:40:18 +0000 (20:40 -0700)
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().

Signed-off-by: Vito Caputo <vcaputo@pengaru.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/unix/af_unix.c

index 67e87db..c853ad0 100644 (file)
@@ -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,