From fb5250243a0189ae4a7a506b435f219b3a1b8766 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 30 Sep 2009 11:38:53 -0700 Subject: [PATCH] kernel - add missing M_ZERO in taskqueue_create() * taskqueue_create() was not ensuring a zero'd task queue structure, resulting in a situation where the flags and other fields could end up as garbage and prevent the taskqueue from being signaled on enqueue. * This bug was responsible for situations where CAM fails to complete its configuration, generating warnings for 60 seconds and then giving up. --- sys/kern/subr_taskqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c index 0cff2ccaed..9b9abb17c4 100644 --- a/sys/kern/subr_taskqueue.c +++ b/sys/kern/subr_taskqueue.c @@ -102,7 +102,7 @@ taskqueue_create(const char *name, int mflags, { struct taskqueue *queue; - queue = kmalloc(sizeof(struct taskqueue), M_TASKQUEUE, mflags); + queue = kmalloc(sizeof(*queue), M_TASKQUEUE, mflags | M_ZERO); if (!queue) return NULL; STAILQ_INIT(&queue->tq_queue); -- 2.11.4.GIT