]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powercap: dtpm_cpu: Fix error check against freq_qos_add_request()
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 13 Feb 2024 22:39:47 +0000 (23:39 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:31 +0000 (18:19 -0400)
commit3b454d50e41d6ed14f6a399a6f6ae359c60cfae3
tree2953b8551501d2b185e561a49808c9828d0d40dc
parent9f31b114d4087238bacc8c3c28123ec32f09409a
powercap: dtpm_cpu: Fix error check against freq_qos_add_request()

[ Upstream commit b50155cb0d609437236c88201206267835c6f965 ]

The caller of the function freq_qos_add_request() checks again a non
zero value but freq_qos_add_request() can return '1' if the request
already exists. Therefore, the setup function fails while the QoS
request actually did not failed.

Fix that by changing the check against a negative value like all the
other callers of the function.

Fixes: 0e8f68d7f0485 ("Add CPU energy model based support")
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/powercap/dtpm_cpu.c