diff options
author | YueHaibing <yuehaibing@huawei.com> | 2021-10-08 15:46:52 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-11-17 09:48:44 +0100 |
commit | 5a893e0eab167421bca07ab4dec04cd56f3b4a6c (patch) | |
tree | b326e6580d5f5cf930446adf3ed2fa71325ef20c /drivers/opp | |
parent | 98ac69821650127addb93381d9a3b20c34e43e43 (diff) |
opp: Fix return in _opp_add_static_v2()
[ Upstream commit 27ff8187f13ecfec8a26fb1928e906f46f326cc5 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/opp')
-rw-r--r-- | drivers/opp/of.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 30cc407c8f93..ba3069450815 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -639,7 +639,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 */ |