提交 015b066f 编写于 作者: K Kristian Høgsberg 提交者: Stefan Richter

firewire: Grab dev->sem when doing the update callback.

This serializes the update callback with the probe and remove callback from
the driver core and prevents remove from being called while update is
running for the same device.
Signed-off-by: NKristian Høgsberg <krh@redhat.com>
Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
上级 11f494ee
......@@ -562,8 +562,11 @@ static int update_unit(struct device *dev, void *data)
struct fw_unit *unit = fw_unit(dev);
struct fw_driver *driver = (struct fw_driver *)dev->driver;
if (is_fw_unit(dev) && driver != NULL && driver->update != NULL)
if (is_fw_unit(dev) && driver != NULL && driver->update != NULL) {
down(&dev->sem);
driver->update(unit);
up(&dev->sem);
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册