diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-07-21 17:51:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 17:51:30 -0400 |
commit | 0da974f4f303a6842516b764507e3c0a03f41e5a (patch) | |
tree | 8872aec792f02040269c6769dd1009b20f71d186 /net/sched/cls_rsvp.h | |
parent | a0ee7c70b22f78593957f99faa06acb4747b8bc0 (diff) |
[NET]: Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_rsvp.h')
-rw-r--r-- | net/sched/cls_rsvp.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h index ba8741971629..6e230ecfba05 100644 --- a/net/sched/cls_rsvp.h +++ b/net/sched/cls_rsvp.h | |||
@@ -240,9 +240,8 @@ static int rsvp_init(struct tcf_proto *tp) | |||
240 | { | 240 | { |
241 | struct rsvp_head *data; | 241 | struct rsvp_head *data; |
242 | 242 | ||
243 | data = kmalloc(sizeof(struct rsvp_head), GFP_KERNEL); | 243 | data = kzalloc(sizeof(struct rsvp_head), GFP_KERNEL); |
244 | if (data) { | 244 | if (data) { |
245 | memset(data, 0, sizeof(struct rsvp_head)); | ||
246 | tp->root = data; | 245 | tp->root = data; |
247 | return 0; | 246 | return 0; |
248 | } | 247 | } |
@@ -446,11 +445,10 @@ static int rsvp_change(struct tcf_proto *tp, unsigned long base, | |||
446 | goto errout2; | 445 | goto errout2; |
447 | 446 | ||
448 | err = -ENOBUFS; | 447 | err = -ENOBUFS; |
449 | f = kmalloc(sizeof(struct rsvp_filter), GFP_KERNEL); | 448 | f = kzalloc(sizeof(struct rsvp_filter), GFP_KERNEL); |
450 | if (f == NULL) | 449 | if (f == NULL) |
451 | goto errout2; | 450 | goto errout2; |
452 | 451 | ||
453 | memset(f, 0, sizeof(*f)); | ||
454 | h2 = 16; | 452 | h2 = 16; |
455 | if (tb[TCA_RSVP_SRC-1]) { | 453 | if (tb[TCA_RSVP_SRC-1]) { |
456 | err = -EINVAL; | 454 | err = -EINVAL; |
@@ -532,10 +530,9 @@ insert: | |||
532 | /* No session found. Create new one. */ | 530 | /* No session found. Create new one. */ |
533 | 531 | ||
534 | err = -ENOBUFS; | 532 | err = -ENOBUFS; |
535 | s = kmalloc(sizeof(struct rsvp_session), GFP_KERNEL); | 533 | s = kzalloc(sizeof(struct rsvp_session), GFP_KERNEL); |
536 | if (s == NULL) | 534 | if (s == NULL) |
537 | goto errout; | 535 | goto errout; |
538 | memset(s, 0, sizeof(*s)); | ||
539 | memcpy(s->dst, dst, sizeof(s->dst)); | 536 | memcpy(s->dst, dst, sizeof(s->dst)); |
540 | 537 | ||
541 | if (pinfo) { | 538 | if (pinfo) { |