diff options
| author | Patrick Kelsey <pkelsey@FreeBSD.org> | 2016-09-01 02:05:46 +0000 |
|---|---|---|
| committer | Patrick Kelsey <pkelsey@FreeBSD.org> | 2016-09-01 02:05:46 +0000 |
| commit | da2ded65755a2e02411931c6dfeb59ad82c60d2d (patch) | |
| tree | 00289f2b4a95764ab2523d0cf51c8e271a3cd071 /sys/kern/subr_taskqueue.c | |
| parent | ff9b61ca075659efd790dd8109b4680f2ac8ea61 (diff) | |
Notes
Diffstat (limited to 'sys/kern/subr_taskqueue.c')
| -rw-r--r-- | sys/kern/subr_taskqueue.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c index 5a20148f573c..21476e6674c3 100644 --- a/sys/kern/subr_taskqueue.c +++ b/sys/kern/subr_taskqueue.c @@ -625,6 +625,11 @@ _taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, } else tq->tq_tcount++; } + if (tq->tq_tcount == 0) { + free(tq->tq_threads, M_TASKQUEUE); + tq->tq_threads = NULL; + return (ENOMEM); + } for (i = 0; i < count; i++) { if (tq->tq_threads[i] == NULL) continue; |
