[PATCH v0 12/42] ethernet: chelsio: Check notifier registration return value
From: Borislav Petkov
Date: Mon Nov 08 2021 - 05:14:11 EST
From: Borislav Petkov <bp@xxxxxxx>
Avoid homegrown notifier registration checks.
No functional changes.
Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Cc: Ayush Sawal <ayush.sawal@xxxxxxxxxxx>
Cc: Vinay Kumar Yadav <vinay.yadav@xxxxxxxxxxx>
Cc: Rohit Maheshwari <rohitm@xxxxxxxxxxx>
---
.../net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c
index 9098b3eed4da..43ee3fb6bc67 100644
--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c
+++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c
@@ -39,7 +39,10 @@ static uint send_page_order = (14 - PAGE_SHIFT < 0) ? 0 : 14 - PAGE_SHIFT;
static void register_listen_notifier(struct notifier_block *nb)
{
mutex_lock(¬ify_mutex);
- raw_notifier_chain_register(&listen_notify_list, nb);
+
+ if (raw_notifier_chain_register(&listen_notify_list, nb))
+ pr_warn("chtls listen notifier already registered\n");
+
mutex_unlock(¬ify_mutex);
}
--
2.29.2