svn commit: r328392 - stable/11/sys/kern

Patrick Kelsey pkelsey at FreeBSD.org
Thu Jan 25 07:27:04 UTC 2018


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;


More information about the svn-src-all mailing list