Date: Tue, 22 May 2012 17:30:02 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r235795 - head/sys/kern Message-ID: <201205221730.q4MHU2fW016196@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <mjguzik at gmail dot com> 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205221730.q4MHU2fW016196>