--- a/kernel/notifier.c~kernel-notifierc-intercepting-duplicate-registrations-to-avoid-infinite-loops +++ a/kernel/notifier.c @@ -23,7 +23,10 @@ static int notifier_chain_register(struc struct notifier_block *n) { while ((*nl) != NULL) { - WARN_ONCE(((*nl) == n), "double register detected"); + if (unlikely((*nl) == n)) { + WARN(1, "double register detected"); + return 0; + } if (n->priority > (*nl)->priority) break; nl = &((*nl)->next);