From owner-svn-src-stable-7@FreeBSD.ORG Tue Dec 21 09:33:06 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C21810656A9; Tue, 21 Dec 2010 09:33:06 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A8AC8FC25; Tue, 21 Dec 2010 09:33:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBL9X6Ro047219; Tue, 21 Dec 2010 09:33:06 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBL9X6QA047217; Tue, 21 Dec 2010 09:33:06 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201012210933.oBL9X6QA047217@svn.freebsd.org> From: Andrew Thompson Date: Tue, 21 Dec 2010 09:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216612 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2010 09:33:06 -0000 Author: thompsa Date: Tue Dec 21 09:33:06 2010 New Revision: 216612 URL: http://svn.freebsd.org/changeset/base/216612 Log: MFC r216371: Fix race in devfs by using LIST_FIRST() instead of LIST_FOREACH_SAFE() when freeing the devfs private data entries. Approved by: re (kib) Modified: stable/7/sys/kern/kern_conf.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_conf.c ============================================================================== --- stable/7/sys/kern/kern_conf.c Tue Dec 21 09:31:48 2010 (r216611) +++ stable/7/sys/kern/kern_conf.c Tue Dec 21 09:33:06 2010 (r216612) @@ -863,7 +863,7 @@ static void destroy_devl(struct cdev *dev) { struct cdevsw *csw; - struct cdev_privdata *p, *p1; + struct cdev_privdata *p; mtx_assert(&devmtx, MA_OWNED); KASSERT(dev->si_flags & SI_NAMED, @@ -908,7 +908,7 @@ destroy_devl(struct cdev *dev) dev_unlock(); notify_destroy(dev); mtx_lock(&cdevpriv_mtx); - LIST_FOREACH_SAFE(p, &dev->si_priv->cdp_fdpriv, cdpd_list, p1) { + while ((p = LIST_FIRST(&dev->si_priv->cdp_fdpriv)) != NULL) { devfs_destroy_cdevpriv(p); mtx_lock(&cdevpriv_mtx); }