int register_nexthop_notifier(struct net *net, struct notifier_block *nb,
                              struct netlink_ext_ack *extack);
+int __unregister_nexthop_notifier(struct net *net, struct notifier_block *nb);
 int unregister_nexthop_notifier(struct net *net, struct notifier_block *nb);
 void nexthop_set_hw_flags(struct net *net, u32 id, bool offload, bool trap);
 void nexthop_bucket_set_hw_flags(struct net *net, u32 id, u16 bucket_index,
 
 }
 EXPORT_SYMBOL(register_nexthop_notifier);
 
-int unregister_nexthop_notifier(struct net *net, struct notifier_block *nb)
+int __unregister_nexthop_notifier(struct net *net, struct notifier_block *nb)
 {
        int err;
 
-       rtnl_lock();
        err = blocking_notifier_chain_unregister(&net->nexthop.notifier_chain,
                                                 nb);
-       if (err)
-               goto unlock;
-       nexthops_dump(net, nb, NEXTHOP_EVENT_DEL, NULL);
-unlock:
+       if (!err)
+               nexthops_dump(net, nb, NEXTHOP_EVENT_DEL, NULL);
+       return err;
+}
+EXPORT_SYMBOL(__unregister_nexthop_notifier);
+
+int unregister_nexthop_notifier(struct net *net, struct notifier_block *nb)
+{
+       int err;
+
+       rtnl_lock();
+       err = __unregister_nexthop_notifier(net, nb);
        rtnl_unlock();
        return err;
 }