summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandr Nedvedicky <sashan@cvs.openbsd.org>2023-06-28 21:33:36 +0000
committerAlexandr Nedvedicky <sashan@cvs.openbsd.org>2023-06-28 21:33:36 +0000
commitd4e7eb93f26b59c29f9a2df55dea598b425c413a (patch)
treee6daa87061110eb57beeea5f74a8fdbf3f007d65
parent7b5b53e368a1f44c8d1491ed4e7fce95be00b235 (diff)
pfioctl() must make sure pfioctl_rw() gets unlocked before function returns.
OK bluhm@
-rw-r--r--sys/net/pf_ioctl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index cfcb0c1e4f3..6ec6d273b97 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.409 2023/06/28 15:36:08 kn Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.410 2023/06/28 21:33:35 sashan Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1506,11 +1506,15 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
int i;
t = pf_find_trans(minor(dev), pr->ticket);
- if (t == NULL)
- return (ENXIO);
+ if (t == NULL) {
+ error = ENXIO;
+ goto fail;
+ }
KASSERT(t->pft_unit == minor(dev));
- if (t->pft_type != PF_TRANS_GETRULE)
- return (EINVAL);
+ if (t->pft_type != PF_TRANS_GETRULE) {
+ error = EINVAL;
+ goto fail;
+ }
NET_LOCK();
PF_LOCK();