_taskqueue_start_threads() now fails if it doesn't actually start any threads.

Reviewed by:	jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D7701
This commit is contained in:
Patrick Kelsey 2016-09-01 02:05:46 +00:00
parent ff9b61ca07
commit da2ded6575
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305169

View File

@ -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;