Commit 54d29ad33e3483bcc7ca433a21cf294854e5154a 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: Dmitry Baryshkov <[email protected]>
---
drivers/power/power_supply_sysfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index c444d6b..49215da 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -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;
}
--
1.5.5.1
--
With best wishes
Dmitry