[PATCH] cpufreq: mediatek-hw: don't use error path on NULL fdvfs
Viresh Kumar
viresh.kumar at linaro.org
Tue Aug 19 21:07:22 PDT 2025
On 19-08-25, 13:21, Nicolas Frattaroli wrote:
> The IS_ERR_OR_NULL check for priv->fdvfs is inappropriate, and should be
> an IS_ERR check instead, as a NULL value here would propagate it to
> PTR_ERR.
>
> In practice, there is no problem here, as devm_of_iomap cannot return
> NULL in any circumstance. However, it causes a Smatch static checker
> warning.
>
> Fix the warning by changing the check from IS_ERR_OR_NULL to IS_ERR.
>
> Fixes: 32e0d669f3ac ("cpufreq: mediatek-hw: Add support for MT8196")
> Reported-by: Dan Carpenter <dan.carpenter at linaro.org>
> Closes: https://lore.kernel.org/linux-pm/aKQubSEXH1TXQpnR@stanley.mountain/
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli at collabora.com>
> ---
> drivers/cpufreq/mediatek-cpufreq-hw.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied. Thanks.
--
viresh
More information about the Linux-mediatek
mailing list