提交 6ac12dfe 编写于 作者: S Sonny Rao 提交者: 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: NSonny Rao <sonny@burdell.org>
Acked-by: NAlessandro Zummo <a.zummo@towertech.it>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 b65b5b59
...@@ -94,7 +94,9 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev, ...@@ -94,7 +94,9 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
kfree(rtc); kfree(rtc);
exit_idr: exit_idr:
mutex_lock(&idr_lock);
idr_remove(&rtc_idr, id); idr_remove(&rtc_idr, id);
mutex_unlock(&idr_lock);
exit: exit:
dev_err(dev, "rtc core: unable to register %s, err = %d\n", dev_err(dev, "rtc core: unable to register %s, err = %d\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册