diff options
author | trasz <trasz@FreeBSD.org> | 2012-05-22 17:30:02 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2012-05-22 17:30:02 +0000 |
commit | a25d879040293674b01528c3026cb54863172d8a (patch) | |
tree | 8734dcc16b70b18ea92d9a69caa16f346c8778bc | |
parent | 310ab6d7ff9b6ca4c8c1159bdd4eafd63aaf34ba (diff) | |
download | FreeBSD-src-a25d879040293674b01528c3026cb54863172d8a.zip FreeBSD-src-a25d879040293674b01528c3026cb54863172d8a.tar.gz |
Don't leak locks in prison_racct_modify().
Submitted by: Mateusz Guzik <mjguzik at gmail dot com>
MFC after: 2 weeks
-rw-r--r-- | sys/kern/kern_jail.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index b782b97..492594d 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -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; |