[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 <sonny@burdell.org>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Sonny Rao 2006-06-27 02:54:06 -07:00 committed by Linus Torvalds
parent b65b5b59f9
commit 6ac12dfe9c

View File

@ -94,7 +94,9 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
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",