Skip to content

Commit

Permalink
net: devlink: add WARN_ON_ONCE to check return value of unregister_ne…
Browse files Browse the repository at this point in the history
…tdevice_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: Ido Schimmel <idosch@idosch.org>
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20221125100255.1786741-1-jiri@resnulli.us
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Jiri Pirko authored and Paolo Abeni committed Nov 29, 2022
1 parent cb55ff7 commit 7666dbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/core/devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7666dbe

Please sign in to comment.