Commit 7666dbec authored by Jiri Pirko's avatar Jiri Pirko Committed by Paolo Abeni

net: devlink: add WARN_ON_ONCE to check return value of unregister_netdevice_notifier_net() call

As the return value is not 0 only in case there is no such notifier
block registered, add a WARN_ON_ONCE() to yell about it.
Suggested-by: default avatarIdo Schimmel <idosch@idosch.org>
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20221125100255.1786741-1-jiri@resnulli.usSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent cb55ff7a
......@@ -9907,8 +9907,8 @@ void devlink_free(struct devlink *devlink)
xa_destroy(&devlink->snapshot_ids);
unregister_netdevice_notifier_net(devlink_net(devlink),
&devlink->netdevice_nb);
WARN_ON_ONCE(unregister_netdevice_notifier_net(devlink_net(devlink),
&devlink->netdevice_nb));
xa_erase(&devlinks, devlink->index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment