Commit 6ac12dfe authored by Sonny Rao's avatar Sonny Rao Committed by Linus Torvalds

[PATCH] rtc: fix idr locking

We need to serialize access to the global rtc_idr even in this error path.
Signed-off-by: default avatarSonny Rao <sonny@burdell.org>
Acked-by: default avatarAlessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b65b5b59
......@@ -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",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment