X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fs390%2Fnet%2Ffsm.c;fp=drivers%2Fs390%2Fnet%2Ffsm.c;h=6caf5fa6a3b525166b4af47e4b29656bc88be74e;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=2c1db8036b7c7aa04bbc33b725da877a0794601b;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/drivers/s390/net/fsm.c b/drivers/s390/net/fsm.c index 2c1db8036..6caf5fa6a 100644 --- a/drivers/s390/net/fsm.c +++ b/drivers/s390/net/fsm.c @@ -4,6 +4,7 @@ */ #include "fsm.h" +#include #include #include @@ -20,34 +21,38 @@ init_fsm(char *name, const char **state_names, const char **event_names, int nr_ fsm_function_t *m; fsm *f; - this = kzalloc(sizeof(fsm_instance), order); + this = (fsm_instance *)kmalloc(sizeof(fsm_instance), order); if (this == NULL) { printk(KERN_WARNING "fsm(%s): init_fsm: Couldn't alloc instance\n", name); return NULL; } + memset(this, 0, sizeof(fsm_instance)); strlcpy(this->name, name, sizeof(this->name)); - f = kzalloc(sizeof(fsm), order); + f = (fsm *)kmalloc(sizeof(fsm), order); if (f == NULL) { printk(KERN_WARNING "fsm(%s): init_fsm: Couldn't alloc fsm\n", name); kfree_fsm(this); return NULL; } + memset(f, 0, sizeof(fsm)); f->nr_events = nr_events; f->nr_states = nr_states; f->event_names = event_names; f->state_names = state_names; this->f = f; - m = kcalloc(nr_states*nr_events, sizeof(fsm_function_t), order); + m = (fsm_function_t *)kmalloc( + sizeof(fsm_function_t) * nr_states * nr_events, order); if (m == NULL) { printk(KERN_WARNING "fsm(%s): init_fsm: Couldn't alloc jumptable\n", name); kfree_fsm(this); return NULL; } + memset(m, 0, sizeof(fsm_function_t) * f->nr_states * f->nr_events); f->jumpmatrix = m; for (i = 0; i < tmpl_len; i++) {