mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix idr locking in rtc class
@ 2006-06-27  0:19 Sonny Rao
  2006-06-27  6:55 ` Alessandro Zummo
  0 siblings, 1 reply; 2+ messages in thread
From: Sonny Rao @ 2006-06-27  0:19 UTC (permalink / raw)
  To: linux-kernel, akpm; +Cc: a.zummo

We need to serialize access to the global rtc_idr even in this error path.

Signed-off-by: Sonny Rao <sonny@burdell.org>

--- linux-2.6.17/drivers/rtc/class.c~orig	2006-06-26 19:10:44.738511816 -0500
+++ linux-2.6.17/drivers/rtc/class.c	2006-06-26 19:12:22.008724496 -0500
@@ -93,7 +93,9 @@ exit_kfree:
 	kfree(rtc);
 
 exit_idr:
+	mutex_lock(&idr_lock);
 	idr_remove(&rtc_idr, id);
+	mutex_unlock(&idr_lock);
 
 exit:
 	dev_err(dev, "rtc core: unable to register %s, err = %d\n",

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-27  6:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-27  0:19 [PATCH] fix idr locking in rtc class Sonny Rao
2006-06-27  6:55 ` Alessandro Zummo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®