Patchwork [3.5.y.z,extended,stable] Patch "PM / QoS: fix wrong error-checking condition" has been added to staging queue

mail settings
Submitter Herton Ronaldo Krzesinski
Date Dec. 10, 2012, 2:20 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/204922/
State New
Headers show


Herton Ronaldo Krzesinski - Dec. 10, 2012, 2:20 p.m.
This is a note to let you know that I have just added a patch titled

    PM / QoS: fix wrong error-checking condition

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From eb68b338a00f2ff753bb1a9659dd3e42f8de8517 Mon Sep 17 00:00:00 2001
From: Guennadi Liakhovetski <>
Date: Fri, 23 Nov 2012 20:55:06 +0100
Subject: [PATCH] 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 <>
Signed-off-by: Rafael J. Wysocki <>
Signed-off-by: Herton Ronaldo Krzesinski <>
 drivers/base/power/qos.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index fd849a2..b95ebf2 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -451,7 +451,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;