提交 56fa18e8 编写于 作者: D Dmitry Baryshkov 提交者: Anton Vorontsov

power_supply: Fix race in power_supply_uevent

Commit 54d29ad3 (Power Supply: fix race
in device_create) introduced a race in power_supply_uevent. Previously it
checked that power_supply is available by checking for dev->driver_data.
But now dev->driver_data is set before power_supply->dev is initialised.
Signed-off-by: NDmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: NAnton Vorontsov <cbouatmailru@gmail.com>
上级 d5639230
......@@ -201,7 +201,7 @@ int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env)
dev_dbg(dev, "uevent\n");
if (!psy) {
if (!psy || !psy->dev) {
dev_dbg(dev, "No power supply yet\n");
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册