Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Feb 2018 17:35:40 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329325 - head/sys/kern
Message-ID:  <201802151735.w1FHZetl065897@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Thu Feb 15 17:35:40 2018
New Revision: 329325
URL: https://svnweb.freebsd.org/changeset/base/329325

Log:
  Fix the test for SET_FOREACH termination.
  
  Unlike the queue(3) _FOREACH macros, the iterator for a SET_FOREACH is
  not NULL after the end of the set is reached.

Modified:
  head/sys/kern/subr_compressor.c

Modified: head/sys/kern/subr_compressor.c
==============================================================================
--- head/sys/kern/subr_compressor.c	Thu Feb 15 17:27:34 2018	(r329324)
+++ head/sys/kern/subr_compressor.c	Thu Feb 15 17:35:40 2018	(r329325)
@@ -498,7 +498,7 @@ compressor_init(compressor_cb_t cb, int format, size_t
 		if ((*iter)->format == format)
 			break;
 	}
-	if (iter == NULL)
+	if (iter == SET_LIMIT(compressors))
 		return (NULL);
 
 	priv = (*iter)->init(maxiosize, level);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802151735.w1FHZetl065897>