git: 7cbe771f013f - main - netlink: call genetlink notification handler upon successful family search.

From: Alexander V. Chernikov <melifaro_at_FreeBSD.org>
Date: Fri, 17 Feb 2023 18:16:47 UTC
The branch main has been updated by melifaro:

URL: https://cgit.FreeBSD.org/src/commit/?id=7cbe771f013f6cf3316910648f6d46641cad7f44

commit 7cbe771f013f6cf3316910648f6d46641cad7f44
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2023-02-17 17:58:53 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2023-02-17 18:16:07 +0000

    netlink: call genetlink notification handler upon successful family
    search.
    
    MFC after:      3 days
---
 sys/netlink/netlink_generic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c
index 028ea24fc5e9..066379e2afae 100644
--- a/sys/netlink/netlink_generic.c
+++ b/sys/netlink/netlink_generic.c
@@ -160,9 +160,8 @@ genl_unregister_family(const char *family_name)
 	GENL_LOCK();
 	struct genl_family *gf = find_family(family_name);
 
-	nlctrl_notify(gf, CTRL_CMD_DELFAMILY);
-
 	if (gf != NULL) {
+		nlctrl_notify(gf, CTRL_CMD_DELFAMILY);
 		found = true;
 		unregister_groups(gf);
 		/* TODO: zero pointer first */