Skip to content

Commit

Permalink
power_supply: Fix race in power_supply_uevent
Browse files Browse the repository at this point in the history
Commit 54d29ad (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: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
  • Loading branch information
Dmitry Baryshkov authored and Anton Vorontsov committed Jun 9, 2008
1 parent d563923 commit 56fa18e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/power_supply_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 56fa18e

Please sign in to comment.