[PATCH] clk: remove clock notifier at unregister

David Andrey david.andrey at netmodule.com
Mon Apr 22 08:22:41 EDT 2013


Clock notifier node is now removed from the
notifier list during unregister

Signed-off-by: David Andrey <david.andrey at netmodule.com>
Acked-by: Martin Meuli <martin.meuli at netmodule.com>
---
 drivers/clk/clk.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 20ce67f..eb66434 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1941,7 +1941,10 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb)
 
 		/* XXX the notifier code should handle this better */
 		if (!cn->notifier_head.head) {
+			if (clk->notifier_count)
+				BUG();
 			srcu_cleanup_notifier_head(&cn->notifier_head);
+			list_del(&cn->node);
 			kfree(cn);
 		}
 
-- 
1.7.4.1




More information about the linux-arm-kernel mailing list