mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/2] notifiers: double register detection
@ 2016-09-21 12:33 Vasily Averin
  2016-10-27 10:44 ` Vasily Averin
  0 siblings, 1 reply; 2+ messages in thread
From: Vasily Averin @ 2016-09-21 12:33 UTC (permalink / raw)
  To: linux-kernel, linux-nfs; +Cc: J. Bruce Fields, Jeff Layton, Scott Mayhew

WARN_ON should help to detect double register of the same notifiers

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 kernel/notifier.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/notifier.c b/kernel/notifier.c
index fd2c9ac..e02b2f0 100644
--- a/kernel/notifier.c
+++ b/kernel/notifier.c
@@ -22,6 +22,7 @@ static int notifier_chain_register(struct notifier_block **nl,
 		struct notifier_block *n)
 {
 	while ((*nl) != NULL) {
+		WARN_ON((*nl) == n);
 		if (n->priority > (*nl)->priority)
 			break;
 		nl = &((*nl)->next);
-- 
1.9.1

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

end of thread, other threads:[~2016-10-27 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21 12:33 [PATCH 2/2] notifiers: double register detection Vasily Averin
2016-10-27 10:44 ` Vasily Averin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®