cpufreq: mediatek: fix passing zero to 'PTR_ERR'
authorJia-Wei Chang <jia-wei.chang@mediatek.com>
Fri, 24 Mar 2023 10:11:27 +0000 (18:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:11 +0000 (23:03 +0900)
commitbd1c00687249b514f94abc52b8ef761eeec67363
treec63d6d6d09a93d0f70729f966d34f6bf137c59b8
parentf977dbefeaea05a198b0537052ebcfd3aa62f7a8
cpufreq: mediatek: fix passing zero to 'PTR_ERR'

[ Upstream commit d51c63230994f167126d9d8381011b4cb2b0ad22 ]

In order to prevent passing zero to 'PTR_ERR' in
mtk_cpu_dvfs_info_init(), we fix the return value of of_get_cci() using
error pointer by explicitly casting error number.

Signed-off-by: Jia-Wei Chang <jia-wei.chang@mediatek.com>
Fixes: 0daa47325bae ("cpufreq: mediatek: Link CCI device to CPU")
Reported-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/mediatek-cpufreq.c