lkml.org 
[lkml]   [2021]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v0 22/42] net: fib_notifier: Check notifier registration return value
Date
From: Borislav Petkov <bp@suse.de>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: netdev@vger.kernel.org
---
net/core/fib_notifier.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c
index fc96259807b6..fa07d6a81ba0 100644
--- a/net/core/fib_notifier.c
+++ b/net/core/fib_notifier.c
@@ -86,7 +86,9 @@ static bool fib_dump_is_consistent(struct net *net, struct notifier_block *nb,
{
struct fib_notifier_net *fn_net = net_generic(net, fib_notifier_net_id);

- atomic_notifier_chain_register(&fn_net->fib_chain, nb);
+ if (atomic_notifier_chain_register(&fn_net->fib_chain, nb))
+ pr_warn("FIB notifier already registered\n");
+
if (fib_seq == fib_seq_sum(net))
return true;
atomic_notifier_chain_unregister(&fn_net->fib_chain, nb);
--
2.29.2
\
 
 \ /
  Last update: 2021-11-08 11:15    [W:0.234 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site