]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PM / QoS: fix wrong error-checking condition
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Fri, 23 Nov 2012 19:55:06 +0000 (20:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Dec 2012 19:38:01 +0000 (11:38 -0800)
commitdc541b2ba0e0aa83831ca99ba1e5a574e41d3c5b
tree3cf9402f0bb2c946b2ed17c855101e30d1547af1
parentcbda50306446b3f359bbf2874a99979990b0627c
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>
drivers/base/power/qos.c