From owner-svn-src-all@FreeBSD.ORG Tue Jan 8 04:43:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DC3E1C5E; Tue, 8 Jan 2013 04:43:20 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CD33A9E7; Tue, 8 Jan 2013 04:43:20 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r084hKrx017953; Tue, 8 Jan 2013 04:43:20 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r084hKsp017952; Tue, 8 Jan 2013 04:43:20 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201301080443.r084hKsp017952@svn.freebsd.org> From: Kevin Lo Date: Tue, 8 Jan 2013 04:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245149 - stable/9/sys/libkern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 04:43:20 -0000 Author: kevlo Date: Tue Jan 8 04:43:20 2013 New Revision: 245149 URL: http://svnweb.freebsd.org/changeset/base/245149 Log: MFC r236899: Fix unloading of libiconv module. Previously it would either loop infinitely or exit with error leaking a lock. Modified: stable/9/sys/libkern/iconv.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/libkern/iconv.c ============================================================================== --- stable/9/sys/libkern/iconv.c Tue Jan 8 03:27:37 2013 (r245148) +++ stable/9/sys/libkern/iconv.c Tue Jan 8 04:43:20 2013 (r245149) @@ -84,9 +84,11 @@ iconv_mod_unload(void) struct iconv_cspair *csp; sx_xlock(&iconv_lock); - while ((csp = TAILQ_FIRST(&iconv_cslist)) != NULL) { - if (csp->cp_refcount) + TAILQ_FOREACH(csp, &iconv_cslist, cp_link) { + if (csp->cp_refcount) { + sx_xunlock(&iconv_lock); return EBUSY; + } } while ((csp = TAILQ_FIRST(&iconv_cslist)) != NULL)