From f73592503981eaacf1836f0d0049bed2f989212e Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 30 Aug 2020 09:59:03 +0200 Subject: Added kernel testing suit --- kernel/features/event.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kernel/features/event.c') diff --git a/kernel/features/event.c b/kernel/features/event.c index 5436ef5..71c0ad9 100644 --- a/kernel/features/event.c +++ b/kernel/features/event.c @@ -29,14 +29,14 @@ void event_unregister(enum message_type id, struct proc *proc) { assert(id < sizeof(event_table) / sizeof(*event_table)); - struct event_descriptor *desc = malloc(sizeof(*desc)); - desc->id = id; - desc->proc = proc; + struct event_descriptor desc; + desc.id = id; + desc.proc = proc; struct node *iterator = event_table[id]->head; do { struct event_descriptor *desc_comp = iterator->data; - if (desc_comp->id == desc->id && desc_comp->proc == desc->proc) + if (desc_comp->id == desc.id && desc_comp->proc == desc.proc) list_remove(event_table[id], iterator); } while ((iterator = iterator->next) != NULL); } -- cgit v1.2.3