aboutsummaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2012-11-23 20:55:06 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-12-03 11:47:10 -0800
commitc4e9e580078376f7fd53fcf3a27f3a1259ebe463 (patch)
tree3d8aec8ed267593a784624f7183119884ceb3f1b /drivers/base
parent98165e2b0d355759c16bae8d9ae09b445149cfbd (diff)
PM / QoS: fix wrong error-checking condition
commit a7227a0faa117d0bc532aea546ae5ac5f89e8ed7 upstream. dev_pm_qos_add_request() can return 0, 1, or a negative error code, therefore the correct error test is "if (error < 0)." Checking just for non-zero return code leads to erroneous setting of the req->dev pointer to NULL, which then leads to a repeated call to dev_pm_qos_add_ancestor_request() in st1232_ts_irq_handler(). This in turn leads to an Oops, when the I2C host adapter is unloaded and reloaded again because of the inconsistent state of its QoS request list. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/qos.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index 71855570922..c365c93abe1 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -446,7 +446,7 @@ int dev_pm_qos_add_ancestor_request(struct device *dev,
if (ancestor)
error = dev_pm_qos_add_request(ancestor, req, value);
- if (error)
+ if (error < 0)
req->dev = NULL;
return error;