PERFORCE change 167163 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Aug 10 09:55:48 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=167163

Change 167163 by trasz at 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);


More information about the p4-projects mailing list