Skip to content

Commit 27ff818

Browse files
YueHaibingvireshk
authored andcommitted
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: deac870 ("PM / OPP: _of_add_opp_table_v2(): increment count only if OPP is added") Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent 4844bdb commit 27ff818

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/opp/of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
921921
free_opp:
922922
_opp_free(new_opp);
923923

924-
return ERR_PTR(ret);
924+
return ret ? ERR_PTR(ret) : NULL;
925925
}
926926

927927
/* Initializes OPP tables based on new bindings */

0 commit comments

Comments
 (0)