From 6ce907eeaaea842ce42684fe0abe2224a9e4b7db Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 5 Apr 2014 13:31:00 +0000 Subject: Be sure to release rwlock when returning error in pppxclose(). --- sys/net/if_pppx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys') 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 @@ -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))) -- cgit v1.2.3