diff options
| -rw-r--r-- | include/net/sctp/sctp.h | 3 | ||||
| -rw-r--r-- | net/sctp/associola.c | 2 | ||||
| -rw-r--r-- | net/sctp/bind_addr.c | 2 | ||||
| -rw-r--r-- | net/sctp/endpointola.c | 3 | ||||
| -rw-r--r-- | net/sctp/ipv6.c | 2 | ||||
| -rw-r--r-- | net/sctp/protocol.c | 2 | ||||
| -rw-r--r-- | net/sctp/transport.c | 2 |
7 files changed, 7 insertions, 9 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index cd89510eab2a..b9f136ad5a5a 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -575,9 +575,6 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\ | |||
| 575 | /* Round an int up to the next multiple of 4. */ | 575 | /* Round an int up to the next multiple of 4. */ |
| 576 | #define WORD_ROUND(s) (((s)+3)&~3) | 576 | #define WORD_ROUND(s) (((s)+3)&~3) |
| 577 | 577 | ||
| 578 | /* Make a new instance of type. */ | ||
| 579 | #define t_new(type, flags) kzalloc(sizeof(type), flags) | ||
| 580 | |||
| 581 | /* Compare two timevals. */ | 578 | /* Compare two timevals. */ |
| 582 | #define tv_lt(s, t) \ | 579 | #define tv_lt(s, t) \ |
| 583 | (s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec)) | 580 | (s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec)) |
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 756025c98e85..bf6e6bd553c0 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c | |||
| @@ -355,7 +355,7 @@ struct sctp_association *sctp_association_new(const struct sctp_endpoint *ep, | |||
| 355 | { | 355 | { |
| 356 | struct sctp_association *asoc; | 356 | struct sctp_association *asoc; |
| 357 | 357 | ||
| 358 | asoc = t_new(struct sctp_association, gfp); | 358 | asoc = kzalloc(sizeof(*asoc), gfp); |
| 359 | if (!asoc) | 359 | if (!asoc) |
| 360 | goto fail; | 360 | goto fail; |
| 361 | 361 | ||
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index 41145fe31813..64977ea0f9c5 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c | |||
| @@ -162,7 +162,7 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new, | |||
| 162 | struct sctp_sockaddr_entry *addr; | 162 | struct sctp_sockaddr_entry *addr; |
| 163 | 163 | ||
| 164 | /* Add the address to the bind address list. */ | 164 | /* Add the address to the bind address list. */ |
| 165 | addr = t_new(struct sctp_sockaddr_entry, gfp); | 165 | addr = kzalloc(sizeof(*addr), gfp); |
| 166 | if (!addr) | 166 | if (!addr) |
| 167 | return -ENOMEM; | 167 | return -ENOMEM; |
| 168 | 168 | ||
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 5fbd7bc6bb11..a8b26741c0af 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
| @@ -192,9 +192,10 @@ struct sctp_endpoint *sctp_endpoint_new(struct sock *sk, gfp_t gfp) | |||
| 192 | struct sctp_endpoint *ep; | 192 | struct sctp_endpoint *ep; |
| 193 | 193 | ||
| 194 | /* Build a local endpoint. */ | 194 | /* Build a local endpoint. */ |
| 195 | ep = t_new(struct sctp_endpoint, gfp); | 195 | ep = kzalloc(sizeof(*ep), gfp); |
| 196 | if (!ep) | 196 | if (!ep) |
| 197 | goto fail; | 197 | goto fail; |
| 198 | |||
| 198 | if (!sctp_endpoint_init(ep, sk, gfp)) | 199 | if (!sctp_endpoint_init(ep, sk, gfp)) |
| 199 | goto fail_init; | 200 | goto fail_init; |
| 200 | 201 | ||
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index fffc7b62a9a8..4f3e13b31fcc 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
| @@ -402,7 +402,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist, | |||
| 402 | read_lock_bh(&in6_dev->lock); | 402 | read_lock_bh(&in6_dev->lock); |
| 403 | list_for_each_entry(ifp, &in6_dev->addr_list, if_list) { | 403 | list_for_each_entry(ifp, &in6_dev->addr_list, if_list) { |
| 404 | /* Add the address to the local list. */ | 404 | /* Add the address to the local list. */ |
| 405 | addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC); | 405 | addr = kzalloc(sizeof(*addr), GFP_ATOMIC); |
| 406 | if (addr) { | 406 | if (addr) { |
| 407 | addr->a.v6.sin6_family = AF_INET6; | 407 | addr->a.v6.sin6_family = AF_INET6; |
| 408 | addr->a.v6.sin6_port = 0; | 408 | addr->a.v6.sin6_port = 0; |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index eaee00c61139..fad7d1b67be5 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
| @@ -153,7 +153,7 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist, | |||
| 153 | 153 | ||
| 154 | for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) { | 154 | for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) { |
| 155 | /* Add the address to the local list. */ | 155 | /* Add the address to the local list. */ |
| 156 | addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC); | 156 | addr = kzalloc(sizeof(*addr), GFP_ATOMIC); |
| 157 | if (addr) { | 157 | if (addr) { |
| 158 | addr->a.v4.sin_family = AF_INET; | 158 | addr->a.v4.sin_family = AF_INET; |
| 159 | addr->a.v4.sin_port = 0; | 159 | addr->a.v4.sin_port = 0; |
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 098f1d5f769e..5d3c71bbd197 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c | |||
| @@ -116,7 +116,7 @@ struct sctp_transport *sctp_transport_new(struct net *net, | |||
| 116 | { | 116 | { |
| 117 | struct sctp_transport *transport; | 117 | struct sctp_transport *transport; |
| 118 | 118 | ||
| 119 | transport = t_new(struct sctp_transport, gfp); | 119 | transport = kzalloc(sizeof(*transport), gfp); |
| 120 | if (!transport) | 120 | if (!transport) |
| 121 | goto fail; | 121 | goto fail; |
| 122 | 122 | ||
