[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20080608154342.GA6935@doriath.ww600.siemens.net>
Date: Sun, 8 Jun 2008 19:43:42 +0400
From: Dmitry Baryshkov <dbaryshkov@...il.com>
To: linux-kernel@...r.kernel.org
Cc: cbou@...l.ru, dwmw2@...radead.org
Subject: [PATCH] Fix race in power_supply_uevent.
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 <dbaryshkov@...il.com>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists