aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/socket.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index c1f239ac12b9..2fc036699d48 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4019,8 +4019,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
4019 return -EINVAL; 4019 return -EINVAL;
4020 4020
4021 to = optval + offsetof(struct sctp_getaddrs,addrs); 4021 to = optval + offsetof(struct sctp_getaddrs,addrs);
4022 space_left = len - sizeof(struct sctp_getaddrs) - 4022 space_left = len - offsetof(struct sctp_getaddrs,addrs);
4023 offsetof(struct sctp_getaddrs,addrs);
4024 4023
4025 list_for_each(pos, &asoc->peer.transport_addr_list) { 4024 list_for_each(pos, &asoc->peer.transport_addr_list) {
4026 from = list_entry(pos, struct sctp_transport, transports); 4025 from = list_entry(pos, struct sctp_transport, transports);
@@ -4327,8 +4326,8 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
4327 } 4326 }
4328 4327
4329 to = optval + offsetof(struct sctp_getaddrs,addrs); 4328 to = optval + offsetof(struct sctp_getaddrs,addrs);
4330 space_left = len - sizeof(struct sctp_getaddrs) - 4329 space_left = len - offsetof(struct sctp_getaddrs,addrs);
4331 offsetof(struct sctp_getaddrs,addrs); 4330
4332 addrs = kmalloc(space_left, GFP_KERNEL); 4331 addrs = kmalloc(space_left, GFP_KERNEL);
4333 if (!addrs) 4332 if (!addrs)
4334 return -ENOMEM; 4333 return -ENOMEM;