diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-06-08 17:43:42 +0200 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2008-06-10 00:13:51 +0200 |
commit | 56fa18e8f1ef6b3995a4511e61103d0f9205ff4a (patch) | |
tree | 7d1bd03f812355c7354032cb941636512fd78220 /drivers/power | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiw... (diff) | |
download | linux-56fa18e8f1ef6b3995a4511e61103d0f9205ff4a.tar.xz linux-56fa18e8f1ef6b3995a4511e61103d0f9205ff4a.zip |
power_supply: Fix race in power_supply_uevent
Commit 54d29ad33e3483bcc7ca433a21cf294854e5154a (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>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | 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 c444d6b10c58..49215da5249b 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; } |