git: 550133f1d488 - main - pf: ensure we exit net_epoch if pf_keth_anchor_nvcopyout() fails

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Sun, 08 Sep 2024 17:59:46 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=550133f1d48882418d4ef6205020b8e06cfd23ec

commit 550133f1d48882418d4ef6205020b8e06cfd23ec
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-09-06 14:47:27 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-09-08 17:56:20 +0000

    pf: ensure we exit net_epoch if pf_keth_anchor_nvcopyout() fails
    
    Reviewed by:    markj
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D46599
---
 sys/netpfil/pf/pf_ioctl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index 64086bf08871..8d18da6cf0db 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -2951,8 +2951,10 @@ DIOCGETETHRULES_error:
 		NET_EPOCH_ENTER(et);
 		PF_RULES_RUNLOCK();
 		nvl = pf_keth_rule_to_nveth_rule(rule);
-		if (pf_keth_anchor_nvcopyout(rs, rule, nvl))
+		if (pf_keth_anchor_nvcopyout(rs, rule, nvl)) {
+			NET_EPOCH_EXIT(et);
 			ERROUT(EBUSY);
+		}
 		NET_EPOCH_EXIT(et);
 		if (nvl == NULL)
 			ERROUT(ENOMEM);