aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/tomoyo/network.c')
-rw-r--r--security/tomoyo/network.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/security/tomoyo/network.c b/security/tomoyo/network.c
index cd6932e5225c..9094f4b3b367 100644
--- a/security/tomoyo/network.c
+++ b/security/tomoyo/network.c
@@ -655,10 +655,11 @@ int tomoyo_socket_listen_permission(struct socket *sock)
return 0;
{
const int error = sock->ops->getname(sock, (struct sockaddr *)
- &addr, &addr_len, 0);
+ &addr, 0);
- if (error)
+ if (error < 0)
return error;
+ addr_len = error;
}
address.protocol = type;
address.operation = TOMOYO_NETWORK_LISTEN;