]> git.hungrycats.org Git - linux/commit
powercap: dtpm_devfreq: Fix error check against dev_pm_qos_add_request()
authorYuan Can <yuancan@huawei.com>
Fri, 18 Oct 2024 02:12:05 +0000 (10:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 00:56:05 +0000 (01:56 +0100)
commit796adf538df7f2cbc5acb45a03a2127033ac7348
tree86dfc2b5e99d9c21e0c6881ab599b613fc8d201b
parentd2826873db70a6719cdd9212a6739f3e6234cfc4
powercap: dtpm_devfreq: Fix error check against dev_pm_qos_add_request()

[ Upstream commit 5209d1b654f1db80509040cc694c7814a1b547e3 ]

The caller of the function dev_pm_qos_add_request() checks again a non
zero value but dev_pm_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: e44655617317 ("powercap/drivers/dtpm: Add dtpm devfreq with energy model support")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20241018021205.46460-1-yuancan@huawei.com
[ rjw: Subject edit ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/powercap/dtpm_devfreq.c