From 72907ea795e0bf261def10595d19ded441b90d9f Mon Sep 17 00:00:00 2001 From: Nicolas Frattaroli Date: Tue, 19 Aug 2025 13:21:42 +0200 Subject: [PATCH] cpufreq: mediatek-hw: don't use error path on NULL fdvfs 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 Closes: https://lore.kernel.org/linux-pm/aKQubSEXH1TXQpnR@stanley.mountain/ Signed-off-by: Nicolas Frattaroli Signed-off-by: Viresh Kumar --- drivers/cpufreq/mediatek-cpufreq-hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/mediatek-cpufreq-hw.c b/drivers/cpufreq/mediatek-cpufreq-hw.c index e4eadce6f937c..fce5aa5ceea03 100644 --- a/drivers/cpufreq/mediatek-cpufreq-hw.c +++ b/drivers/cpufreq/mediatek-cpufreq-hw.c @@ -72,7 +72,7 @@ static const struct mtk_cpufreq_variant cpufreq_mtk_base_variant = { static int mtk_cpufreq_hw_mt8196_init(struct mtk_cpufreq_priv *priv) { priv->fdvfs = devm_of_iomap(priv->dev, priv->dev->of_node, 0, NULL); - if (IS_ERR_OR_NULL(priv->fdvfs)) + if (IS_ERR(priv->fdvfs)) return dev_err_probe(priv->dev, PTR_ERR(priv->fdvfs), "failed to get fdvfs iomem\n"); -- 2.47.3