X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fsched%2Fcls_route.c;h=520ff716dab2f0d744845747366f320dd83f9434;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=d3aea730d4c85d923cda240af52272d91cf6e5da;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index d3aea730d..520ff716d 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -396,9 +397,10 @@ static int route4_set_parms(struct tcf_proto *tp, unsigned long base, h1 = to_hash(nhandle); if ((b = head->table[h1]) == NULL) { err = -ENOBUFS; - b = kzalloc(sizeof(struct route4_bucket), GFP_KERNEL); + b = kmalloc(sizeof(struct route4_bucket), GFP_KERNEL); if (b == NULL) goto errout; + memset(b, 0, sizeof(*b)); tcf_tree_lock(tp); head->table[h1] = b; @@ -474,18 +476,20 @@ static int route4_change(struct tcf_proto *tp, unsigned long base, err = -ENOBUFS; if (head == NULL) { - head = kzalloc(sizeof(struct route4_head), GFP_KERNEL); + head = kmalloc(sizeof(struct route4_head), GFP_KERNEL); if (head == NULL) goto errout; + memset(head, 0, sizeof(struct route4_head)); tcf_tree_lock(tp); tp->root = head; tcf_tree_unlock(tp); } - f = kzalloc(sizeof(struct route4_filter), GFP_KERNEL); + f = kmalloc(sizeof(struct route4_filter), GFP_KERNEL); if (f == NULL) goto errout; + memset(f, 0, sizeof(*f)); err = route4_set_parms(tp, base, f, handle, head, tb, tca[TCA_RATE-1], 1);