diff mbox

OMAP:clock: missing list_del for clk_notifier_unregister

Message ID 49B7FC0C.9080408@gmail.com (mailing list archive)
State Accepted
Delegated to: Kevin Hilman
Headers show

Commit Message

Nishanth Menon March 11, 2009, 5:59 p.m. UTC
From b30537e692ac7e72858479327935b16813ea3f56 Mon Sep 17 00:00:00 2001
From: Nishanth Menon <nm@ti.com>
Date: Wed, 11 Mar 2009 11:29:11 -0500
Subject: [PATCH] OMAP:clock: missing list_del for clk_notifier_unregister

Apologies on the spam.. looks like my git-send-email needs a bit more
tweaking :(.. sending from gmail..

clk_notifier_unregister should clean the list before
freeing clock notifier, else clk_notifier_list is
filled with dangling pointers

Issue seen while repetative loading/unloading of bridgedriver

Ref: http://marc.info/?t=123678326300002&r=1&w=2

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/plat-omap/clock.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

         r = -ENOENT;
diff mbox

Patch

diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index c8d9e96..523d1b0 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -725,8 +725,11 @@  int clk_notifier_unregister(struct clk *clk, struct
notifier_block *nb)
          * XXX ugh, layering violation.  there should be some
          * support in the notifier code for this.
          */
-        if (!cn->notifier_head.head)
+        if (!cn->notifier_head.head) {
+            /* Free up my clock node too */
+            list_del(&cn->node);
             kfree(cn);
+        }
 
     } else {