summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-14 15:12:17 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-14 15:12:17 +0200
commit75e1d828c670ee53442f85f1697a522db0300d84 (patch)
treeb44b62263c1a7d03b3884c4751b2f5c4eb5b4108 /drivers
parentc01782d8190cf89c0642b2246caa17c27be0c54a (diff)
parent6bc08ed02385378d8c84410fb407fe5640834350 (diff)
Merge branch 'pm-fixes'
* pm-fixes: PM / hibernate: Correct documentation PM / Documentation: remove inaccurate suspend/hibernate transition lantency statement PM: Documentation update for freeze state PM: Avoid calling kfree() under spinlock in dev_pm_put_subsys_data()
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/power/common.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
index 39c32529b83..5da91404130 100644
--- a/drivers/base/power/common.c
+++ b/drivers/base/power/common.c
@@ -61,24 +61,24 @@ EXPORT_SYMBOL_GPL(dev_pm_get_subsys_data);
int dev_pm_put_subsys_data(struct device *dev)
{
struct pm_subsys_data *psd;
- int ret = 0;
+ int ret = 1;
spin_lock_irq(&dev->power.lock);
psd = dev_to_psd(dev);
- if (!psd) {
- ret = -EINVAL;
+ if (!psd)
goto out;
- }
if (--psd->refcount == 0) {
dev->power.subsys_data = NULL;
- kfree(psd);
- ret = 1;
+ } else {
+ psd = NULL;
+ ret = 0;
}
out:
spin_unlock_irq(&dev->power.lock);
+ kfree(psd);
return ret;
}