aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorSonny Rao <[email protected]>2006-06-27 09:54:06 +0000
committerLinus Torvalds <[email protected]>2006-06-28 00:32:40 +0000
commit6ac12dfe9c2027cd3c5ed603f11d1bb4f04906fe (patch)
tree7c1cb6d405dcaf959d9b1f67f62991775722fcde /drivers/rtc
parent[PATCH] stallion clean up (diff)
downloadkernel-6ac12dfe9c2027cd3c5ed603f11d1bb4f04906fe.tar.gz
kernel-6ac12dfe9c2027cd3c5ed603f11d1bb4f04906fe.zip
[PATCH] rtc: fix idr locking
We need to serialize access to the global rtc_idr even in this error path. Signed-off-by: Sonny Rao <[email protected]> Acked-by: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/class.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 5396beec30d0..1cb61a761cb2 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -94,7 +94,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",