diff options
| author | maxv <maxv@NetBSD.org> | 2014-11-04 16:01:58 +0000 |
|---|---|---|
| committer | maxv <maxv@NetBSD.org> | 2014-11-04 16:01:58 +0000 |
| commit | 404da71becf1ff11a40af95f582fb99bb124b0b5 (patch) | |
| tree | fb2f9c0e49495fc7ca03bcf70931ef5ab6176829 /sys/secmodel | |
| parent | fbbc5b56e1ff22c38670b5e30aefe8cb6ad55326 (diff) | |
Do not release secmodels_lock when it is not held.
Sent on tech-kern@, ok lars@
Diffstat (limited to 'sys/secmodel')
| -rw-r--r-- | sys/secmodel/secmodel.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/secmodel/secmodel.c b/sys/secmodel/secmodel.c index c5d8d3855cc..e778af60e7d 100644 --- a/sys/secmodel/secmodel.c +++ b/sys/secmodel/secmodel.c @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel.c,v 1.1 2011/12/04 19:24:59 jym Exp $ */ +/* $NetBSD: secmodel.c,v 1.2 2014/11/04 16:01:58 maxv Exp $ */ /*- * Copyright (c) 2011 Elad Efrat <elad@NetBSD.org> * All rights reserved. @@ -171,10 +171,8 @@ secmodel_plug(secmodel_t sm) secmodel_t tsm; int error = 0; - if (sm == NULL) { - error = EFAULT; - goto out; - } + if (sm == NULL) + return EFAULT; /* Check if the secmodel is already present. */ rw_enter(&secmodels_lock, RW_WRITER); @@ -203,10 +201,8 @@ secmodel_unplug(secmodel_t sm) secmodel_t tsm; int error = 0; - if (sm == NULL) { - error = EFAULT; - goto out; - } + if (sm == NULL) + return EFAULT; /* Make sure the secmodel is present. */ rw_enter(&secmodels_lock, RW_WRITER); |
