Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

YueHaibing and committed by
Viresh Kumar
27ff8187 4844bdbe

+1 -1
+1 -1
drivers/opp/of.c
··· 921 921 free_opp: 922 922 _opp_free(new_opp); 923 923 924 - return ERR_PTR(ret); 924 + return ret ? ERR_PTR(ret) : NULL; 925 925 } 926 926 927 927 /* Initializes OPP tables based on new bindings */