lkml.org 
[lkml]   [2016]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] notifiers: double register detection
Date
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
\
 
 \ /
  Last update: 2016-09-22 23:59    [W:0.108 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site