Re: [PATCH net-next v2] ipv4: nexthop: handle errors in nexthop_init()

From: Ido Schimmel

Date: Sun Aug 02 2026 - 02:29:19 EST


On Fri, Jul 31, 2026 at 10:52:49AM +0800, Minhong He wrote:
> nexthop_init() ignores errors from register_pernet_subsys() and
> register_netdevice_notifier(), so a partial initialization can appear
> successful.
>
> Check those steps and unwind prior registrations on failure.
>
> Do not check rtnl_register_many(): for built-in code it panics on
> failure, so the call cannot return an error to nexthop_init().
>
> Signed-off-by: Minhong He <heminhong@xxxxxxxxxx>

Reviewed-by: Ido Schimmel <idosch@xxxxxxxxxx>