aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2007-10-15 15:53:13 -0400
committerDavid S. Miller <davem@davemloft.net>2007-10-15 15:53:13 -0400
commitf1673ca52c04f1b311abe03fd67cd4d650d19435 (patch)
tree1e84a0c5021dfb300ee667a123c229bcb2bcaab3
parentc749b01351d249a924d1dd061dd1431bd3ad0579 (diff)
[INET]: kmalloc+memset -> kzalloc in frag_alloc_queue
kmalloc + memset -> kzalloc in frag_alloc_queue Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/ip_fragment.c7
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c7
2 files changed, 4 insertions, 10 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 3171ec0c0fa..443b3f89192 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -144,7 +144,7 @@ static __inline__ void ip4_frag_free(struct inet_frag_queue *q)
144 144
145static __inline__ struct ipq *frag_alloc_queue(void) 145static __inline__ struct ipq *frag_alloc_queue(void)
146{ 146{
147 struct ipq *qp = kmalloc(sizeof(struct ipq), GFP_ATOMIC); 147 struct ipq *qp = kzalloc(sizeof(struct ipq), GFP_ATOMIC);
148 148
149 if (!qp) 149 if (!qp)
150 return NULL; 150 return NULL;
@@ -265,15 +265,10 @@ static struct ipq *ip_frag_create(struct iphdr *iph, u32 user)
265 goto out_nomem; 265 goto out_nomem;
266 266
267 qp->protocol = iph->protocol; 267 qp->protocol = iph->protocol;
268 qp->q.last_in = 0;
269 qp->id = iph->id; 268 qp->id = iph->id;
270 qp->saddr = iph->saddr; 269 qp->saddr = iph->saddr;
271 qp->daddr = iph->daddr; 270 qp->daddr = iph->daddr;
272 qp->user = user; 271 qp->user = user;
273 qp->q.len = 0;
274 qp->q.meat = 0;
275 qp->q.fragments = NULL;
276 qp->iif = 0;
277 qp->peer = sysctl_ipfrag_max_dist ? inet_getpeer(iph->saddr, 1) : NULL; 272 qp->peer = sysctl_ipfrag_max_dist ? inet_getpeer(iph->saddr, 1) : NULL;
278 273
279 /* Initialize a timer for this entry. */ 274 /* Initialize a timer for this entry. */
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index bf6f2f09eae..726fafd4196 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -137,9 +137,10 @@ static void nf_frag_free(struct inet_frag_queue *q)
137 137
138static inline struct nf_ct_frag6_queue *frag_alloc_queue(void) 138static inline struct nf_ct_frag6_queue *frag_alloc_queue(void)
139{ 139{
140 struct nf_ct_frag6_queue *fq = kmalloc(sizeof(struct nf_ct_frag6_queue), GFP_ATOMIC); 140 struct nf_ct_frag6_queue *fq;
141 141
142 if (!fq) 142 fq = kzalloc(sizeof(struct nf_ct_frag6_queue), GFP_ATOMIC);
143 if (fq == NULL)
143 return NULL; 144 return NULL;
144 atomic_add(sizeof(struct nf_ct_frag6_queue), &nf_frags.mem); 145 atomic_add(sizeof(struct nf_ct_frag6_queue), &nf_frags.mem);
145 return fq; 146 return fq;
@@ -230,8 +231,6 @@ nf_ct_frag6_create(unsigned int hash, __be32 id, struct in6_addr *src, str
230 goto oom; 231 goto oom;
231 } 232 }
232 233
233 memset(fq, 0, sizeof(struct nf_ct_frag6_queue));
234
235 fq->id = id; 234 fq->id = id;
236 ipv6_addr_copy(&fq->saddr, src); 235 ipv6_addr_copy(&fq->saddr, src);
237 ipv6_addr_copy(&fq->daddr, dst); 236 ipv6_addr_copy(&fq->daddr, dst);