[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211108101157.15189-17-bp@alien8.de>
Date: Mon, 8 Nov 2021 11:11:31 +0100
From: Borislav Petkov <bp@...en8.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: linux-usb@...r.kernel.org
Subject: [PATCH v0 16/42] USB: 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: linux-usb@...r.kernel.org
---
drivers/usb/core/notify.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c
index e6143663778f..80d1bfa61887 100644
--- a/drivers/usb/core/notify.c
+++ b/drivers/usb/core/notify.c
@@ -28,7 +28,8 @@ static BLOCKING_NOTIFIER_HEAD(usb_notifier_list);
*/
void usb_register_notify(struct notifier_block *nb)
{
- blocking_notifier_chain_register(&usb_notifier_list, nb);
+ if (blocking_notifier_chain_register(&usb_notifier_list, nb))
+ pr_warn("USB change notifier already registered\n");
}
EXPORT_SYMBOL_GPL(usb_register_notify);
--
2.29.2
Powered by blists - more mailing lists