Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 2009 09:55:47 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 167163 for review
Message-ID:  <200908100955.n7A9tlwx003894@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=167163

Change 167163 by trasz@trasz_anger on 2009/08/10 09:55:02

	Callback may cause loginclass refcount to drop to zero and be
	freed; use LIST_FOREACH_SAFE instead of LIST_FOREACH.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_loginclass.c#6 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_loginclass.c#6 (text+ko) ====

@@ -208,9 +208,9 @@
     const struct hrl_rule *filter, void *arg3)
 {
 	int error;
-	struct loginclass *lc;
+	struct loginclass *lc, *lctmp;
 
-	LIST_FOREACH(lc, &loginclasses, lc_next) {
+	LIST_FOREACH_SAFE(lc, &loginclasses, lc_next, lctmp) {
 		error = (callback)(&lc->lc_limits, filter, arg3);
 		if (error)
 			return (error);



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