X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fsched%2Fsch_gred.c;h=3cc6dda02e2e0a1297ecc8a2d5a7e3707a4b556c;hb=23aeeec365dcf8bc87fae44c533e50d0bb4f23cc;hp=29a2dd9f30296f613123118976c963f557e899d6;hpb=bdc450a0bb1d48144ced1f899cc8366ec8e85024;p=linux-2.6 diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index 29a2dd9f30..3cc6dda02e 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c @@ -18,11 +18,9 @@ * For all the glorious comments look at include/net/red.h */ -#include #include #include #include -#include #include #include #include @@ -336,7 +334,7 @@ static void gred_reset(struct Qdisc* sch) qdisc_reset_queue(sch); - for (i = 0; i < t->DPs; i++) { + for (i = 0; i < t->DPs; i++) { struct gred_sched_data *q = t->tab[i]; if (!q) @@ -394,7 +392,7 @@ static inline int gred_change_table_def(struct Qdisc *sch, struct rtattr *dps) "shadowed VQ 0x%x\n", i); gred_destroy_vq(table->tab[i]); table->tab[i] = NULL; - } + } } return 0; @@ -407,10 +405,9 @@ static inline int gred_change_vq(struct Qdisc *sch, int dp, struct gred_sched_data *q; if (table->tab[dp] == NULL) { - table->tab[dp] = kmalloc(sizeof(*q), GFP_KERNEL); + table->tab[dp] = kzalloc(sizeof(*q), GFP_KERNEL); if (table->tab[dp] == NULL) return -ENOMEM; - memset(table->tab[dp], 0, sizeof(*q)); } q = table->tab[dp];