Re: [PATCH] cpufreq: mediatek-hw: don't use error path on NULL fdvfs

From: Viresh Kumar
Date: Wed Aug 20 2025 - 00:07:36 EST


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@xxxxxxxxxx>
> Closes: https://lore.kernel.org/linux-pm/aKQubSEXH1TXQpnR@stanley.mountain/
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@xxxxxxxxxxxxx>
> ---
> drivers/cpufreq/mediatek-cpufreq-hw.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied. Thanks.

--
viresh