summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_firmware.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/kern/subr_firmware.c b/sys/kern/subr_firmware.c
index 34a16003a195..d1450e642182 100644
--- a/sys/kern/subr_firmware.c
+++ b/sys/kern/subr_firmware.c
@@ -386,6 +386,8 @@ set_rootvnode(void *arg, int npending)
VREF(rootvnode);
}
FILEDESC_XUNLOCK(p->p_fd);
+
+ free(arg, M_TEMP);
}
/*
@@ -395,10 +397,14 @@ set_rootvnode(void *arg, int npending)
static void
firmware_mountroot(void *arg)
{
- static struct task setroot_task;
-
- TASK_INIT(&setroot_task, 0, set_rootvnode, NULL);
- taskqueue_enqueue(firmware_tq, &setroot_task);
+ struct task *setroot_task;
+
+ setroot_task = malloc(sizeof(struct task), M_TEMP, M_NOWAIT);
+ if (setroot_task != NULL) {
+ TASK_INIT(setroot_task, 0, set_rootvnode, setroot_task);
+ taskqueue_enqueue(firmware_tq, setroot_task);
+ } else
+ printf("%s: no memory for task!\n", __func__);
}
EVENTHANDLER_DEFINE(mountroot, firmware_mountroot, NULL, 0);