Date: Thu, 25 Jan 2018 07:27:03 +0000 (UTC) From: Patrick Kelsey <pkelsey@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328392 - stable/11/sys/kern Message-ID: <201801250727.w0P7R36D072230@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pkelsey Date: Thu Jan 25 07:27:03 2018 New Revision: 328392 URL: https://svnweb.freebsd.org/changeset/base/328392 Log: MFC of r305169: _taskqueue_start_threads() now fails if it doesn't actually start any threads. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D7701 Modified: stable/11/sys/kern/subr_taskqueue.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_taskqueue.c ============================================================================== --- stable/11/sys/kern/subr_taskqueue.c Thu Jan 25 07:19:07 2018 (r328391) +++ stable/11/sys/kern/subr_taskqueue.c Thu Jan 25 07:27:03 2018 (r328392) @@ -672,6 +672,11 @@ _taskqueue_start_threads(struct taskqueue **tqp, int c } 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801250727.w0P7R36D072230>