[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211108101157.15189-23-bp@alien8.de>
Date: Mon, 8 Nov 2021 11:11:37 +0100
From: Borislav Petkov <bp@...en8.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: netdev@...r.kernel.org
Subject: [PATCH v0 22/42] net: fib_notifier: Check notifier registration return value
From: Borislav Petkov <bp@...e.de>
Avoid homegrown notifier registration checks.
No functional changes.
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: netdev@...r.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
Powered by blists - more mailing lists