[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221108132208.938676-4-jiri@resnulli.us>
Date: Tue, 8 Nov 2022 14:22:08 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, idosch@...sch.org, bigeasy@...utronix.de,
imagedong@...cent.com, kuniyu@...zon.com, petrm@...dia.com
Subject: [patch net-next v2 3/3] net: devlink: add WARN_ON to check return value of unregister_netdevice_notifier_net() call
From: Jiri Pirko <jiri@...dia.com>
As the return value is not 0 only in case there is no such notifier
block registered, add a WARN_ON() to yell about it.
Suggested-by: Ido Schimmel <idosch@...sch.org>
Signed-off-by: Jiri Pirko <jiri@...dia.com>
---
net/core/devlink.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/devlink.c b/net/core/devlink.c
index ea0b319385fc..6096baf74b00 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -9843,8 +9843,8 @@ void devlink_free(struct devlink *devlink)
xa_destroy(&devlink->snapshot_ids);
- unregister_netdevice_notifier_net(devlink_net(devlink),
- &devlink->netdevice_nb);
+ WARN_ON(unregister_netdevice_notifier_net(devlink_net(devlink),
+ &devlink->netdevice_nb));
xa_erase(&devlinks, devlink->index);
--
2.37.3
Powered by blists - more mailing lists