*/
#include <linux/kernel.h>
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
do {
level = 0;
list_for_each_entry(p, &cl->children, siblings) {
- if (p->level >= level)
- level = p->level + 1;
+ if (p->level > level)
+ level = p->level;
}
- cl->level = level;
+ cl->level = level + 1;
} while ((cl = cl->cl_parent) != NULL);
}
if (rsc == NULL && fsc == NULL)
return -EINVAL;
- cl = kzalloc(sizeof(struct hfsc_class), GFP_KERNEL);
+ cl = kmalloc(sizeof(struct hfsc_class), GFP_KERNEL);
if (cl == NULL)
return -ENOBUFS;
+ memset(cl, 0, sizeof(struct hfsc_class));
if (rsc != NULL)
hfsc_change_rsc(cl, rsc, 0);