Skip to contentSkip to conversation

OMAP:clock: missing list_del for clk_notifier_unregister

PATCH Paul Walmsley 3 participants 3 messages Mar 12, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

Quoted 33 lines · Nishanth Menon

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

---
 arch/arm/plat-omap/clock.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/plat-omap/clock.c +4 -1
index c8d9e96..523d1b0 100644
@@ -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 {
 		r = -ENOENT;
Signature · 1 line
1.5.4.3

Thanks, this looks good.

Just to clarify, this is currently against the PM branch. There's a new version of the clock notifier patch coming out soon against l-o; will roll this fix in.

- Paul

#2 lore raw
Quoted 10 lines

-----Original Message-----
From: Paul Walmsley [mailto:[email protected]]
Sent: Thursday, March 12, 2009 9:31 AM
To: Menon, Nishanth
Cc: [email protected]; Woodruff, Richard; Nayak, Rajendra; Gupta, Ramesh; Palande Ameya
Subject: Re: [PATCH] OMAP:clock: missing list_del for clk_notifier_unregister

Just to clarify, this is currently against the PM branch. There's a new

Yes. This is against the PM branch

Quoted 3 lines

version of the clock notifier patch coming out soon against l-o; will roll this fix in.

Thanks.
Regards,
Nishanth Menon

#3 lore raw
Quoted 9 lines · Nishanth
Quoted 8 lines

-----Original Message-----
From: Paul Walmsley [mailto:[email protected]]
Sent: Thursday, March 12, 2009 9:31 AM
To: Menon, Nishanth
Cc: [email protected]; Woodruff, Richard; Nayak, Rajendra; Gupta, Ramesh; Palande Ameya
Subject: Re: [PATCH] OMAP:clock: missing list_del for clk_notifier_unregister

Quoted 4 lines
Quoted 1 line

Just to clarify, this is currently against the PM branch. There's a new

Yes. This is against the PM branch

OK, I'll add this to PM branch...

Quoted 2 lines
Quoted 2 lines

version of the clock notifier patch coming out soon against l-o; will roll this fix in.

And then pull in the new version when it appears.

Kevin