summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2022-11-25 13:02:55 +0300
committerPaolo Abeni <pabeni@redhat.com>2022-11-29 15:37:53 +0300
commit7666dbec7268458505d44ef3ae22fd9181c09b01 (patch)
tree24fac626fcacf3a5aa4ded6d7efc666099209894 /net
parentcb55ff7ac471bf011243a633d5ae58679eabd2ad (diff)
downloadlinux-7666dbec7268458505d44ef3ae22fd9181c09b01.tar.xz
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: 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>
Diffstat (limited to 'net')
-rw-r--r--net/core/devlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c
index cea154ddce7a..0e10a8a68c5e 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -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);