All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch net-next] net: devlink: add WARN_ON_ONCE to check return value of unregister_netdevice_notifier_net() call
@ 2022-11-25 10:02 Jiri Pirko
  2022-11-25 10:36 ` Ido Schimmel
  2022-11-29 13:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Pirko @ 2022-11-25 10:02 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, pabeni, edumazet, idosch

From: Jiri Pirko <jiri@nvidia.com>

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>
---
 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 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);
 
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch net-next] net: devlink: add WARN_ON_ONCE to check return value of unregister_netdevice_notifier_net() call
  2022-11-25 10:02 [patch net-next] net: devlink: add WARN_ON_ONCE to check return value of unregister_netdevice_notifier_net() call Jiri Pirko
@ 2022-11-25 10:36 ` Ido Schimmel
  2022-11-29 13:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Ido Schimmel @ 2022-11-25 10:36 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, kuba, pabeni, edumazet

On Fri, Nov 25, 2022 at 11:02:55AM +0100, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch net-next] net: devlink: add WARN_ON_ONCE to check return value of unregister_netdevice_notifier_net() call
  2022-11-25 10:02 [patch net-next] net: devlink: add WARN_ON_ONCE to check return value of unregister_netdevice_notifier_net() call Jiri Pirko
  2022-11-25 10:36 ` Ido Schimmel
@ 2022-11-29 13:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-29 13:30 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, kuba, pabeni, edumazet, idosch

Hello:

This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Fri, 25 Nov 2022 11:02:55 +0100 you wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> 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>
> 
> [...]

Here is the summary with links:
  - [net-next] net: devlink: add WARN_ON_ONCE to check return value of unregister_netdevice_notifier_net() call
    https://git.kernel.org/netdev/net-next/c/7666dbec7268

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-29 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-25 10:02 [patch net-next] net: devlink: add WARN_ON_ONCE to check return value of unregister_netdevice_notifier_net() call Jiri Pirko
2022-11-25 10:36 ` Ido Schimmel
2022-11-29 13:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.