pf: do not leak a source hash row lock in the netlink dump

pf_handle_get_srcnodes() returns with the lock of a source hash row
held when it cannot start the message for a source node.  Unlock the
row there, as the other error exit of the loop does.

Reviewed by:		kp
Approved by:		kp (mentor)
Fixes:			9c12533672 ("pf: convert DIOCGETSRCNODES to netlink")
MFC after:		1 week
Sponsored by:		Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D60251
This commit is contained in:
R. Christian McDonald committed 2026-10-02 13:11:33 -04:00
1 parent 4b267d4e4f
commit 782c6ea086
1 file changed
+1
+1
View File
@@ -1824,6 +1824,7 @@ pf_handle_get_srcnodes(struct nlmsghdr *hdr, struct nl_pstate *npt)
LIST_FOREACH(n, &sh->nodes, entry) {
if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr))) {
PF_HASHROW_UNLOCK(sh);
nlmsg_abort(nw);
return (ENOMEM);
}