提交 a7227a0f 编写于 作者: G Guennadi Liakhovetski 提交者: Rafael J. Wysocki

PM / QoS: fix wrong error-checking condition

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: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 f4a75d2e
...@@ -451,7 +451,7 @@ int dev_pm_qos_add_ancestor_request(struct device *dev, ...@@ -451,7 +451,7 @@ int dev_pm_qos_add_ancestor_request(struct device *dev,
if (ancestor) if (ancestor)
error = dev_pm_qos_add_request(ancestor, req, value); error = dev_pm_qos_add_request(ancestor, req, value);
if (error) if (error < 0)
req->dev = NULL; req->dev = NULL;
return error; return error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册