summaryrefslogtreecommitdiff
path: root/drivers/opp
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2021-10-08 10:46:52 +0300
committerViresh Kumar <viresh.kumar@linaro.org>2021-10-08 10:54:46 +0300
commit27ff8187f13ecfec8a26fb1928e906f46f326cc5 (patch)
tree4f9344eac515ad6310b9a940d02b80558871955e /drivers/opp
parent4844bdbe9166bc3d194b1d20d13dc1f01d3c1bb7 (diff)
downloadlinux-27ff8187f13ecfec8a26fb1928e906f46f326cc5.tar.xz
opp: Fix return in _opp_add_static_v2()
Fix sparse warning: drivers/opp/of.c:924 _opp_add_static_v2() warn: passing zero to 'ERR_PTR' For duplicate OPPs 'ret' be set to zero. Fixes: deac8703da5f ("PM / OPP: _of_add_opp_table_v2(): increment count only if OPP is added") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp')
-rw-r--r--drivers/opp/of.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index fe218af735b0..2f40afa4e65c 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -921,7 +921,7 @@ free_required_opps:
free_opp:
_opp_free(new_opp);
- return ERR_PTR(ret);
+ return ret ? ERR_PTR(ret) : NULL;
}
/* Initializes OPP tables based on new bindings */