From owner-svn-src-head@FreeBSD.ORG Tue May 22 17:30:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 254321065679; Tue, 22 May 2012 17:30:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 101338FC15; Tue, 22 May 2012 17:30:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MHU2dU016197; Tue, 22 May 2012 17:30:02 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MHU2fW016196; Tue, 22 May 2012 17:30:02 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205221730.q4MHU2fW016196@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 22 May 2012 17:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235795 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 17:30:03 -0000 Author: trasz Date: Tue May 22 17:30:02 2012 New Revision: 235795 URL: http://svn.freebsd.org/changeset/base/235795 Log: Don't leak locks in prison_racct_modify(). Submitted by: Mateusz Guzik MFC after: 2 weeks Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue May 22 17:11:18 2012 (r235794) +++ head/sys/kern/kern_jail.c Tue May 22 17:30:02 2012 (r235795) @@ -4491,8 +4491,11 @@ prison_racct_modify(struct prison *pr) sx_slock(&allproc_lock); sx_xlock(&allprison_lock); - if (strcmp(pr->pr_name, pr->pr_prison_racct->prr_name) == 0) + if (strcmp(pr->pr_name, pr->pr_prison_racct->prr_name) == 0) { + sx_xunlock(&allprison_lock); + sx_sunlock(&allproc_lock); return; + } oldprr = pr->pr_prison_racct; pr->pr_prison_racct = NULL;