summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-04-05 13:31:00 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-04-05 13:31:00 +0000
commit6ce907eeaaea842ce42684fe0abe2224a9e4b7db (patch)
tree8e0b7e1f51004457f765011910ef2a5d467b2a82 /sys
parentcf4b8395a00739a2c8782e98bf1af6d22dd9c577 (diff)
Be sure to release rwlock when returning error in pppxclose().
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_pppx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c
index 4dbe420bc18..5571ff14f4d 100644
--- a/sys/net/if_pppx.c
+++ b/sys/net/if_pppx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pppx.c,v 1.27 2014/04/04 03:34:41 jsg Exp $ */
+/* $OpenBSD: if_pppx.c,v 1.28 2014/04/05 13:30:59 miod Exp $ */
/*
* Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org>
@@ -590,8 +590,10 @@ pppxclose(dev_t dev, int flags, int mode, struct proc *p)
rw_enter_write(&pppx_devs_lk);
- if ((pxd = pppx_dev_lookup(dev)) == NULL)
+ if ((pxd = pppx_dev_lookup(dev)) == NULL) {
+ rw_exit_write(&pppx_devs_lk);
return (ENXIO);
+ }
/* XXX */
while ((pxi = LIST_FIRST(&pxd->pxd_pxis)))