Skip to content

Commit 19cc8b1

Browse files
committed
OPP: Check for invalid OPP in dev_pm_opp_find_level_ceil()
_find_key_ceil() may return an error and that must be checked before passing the same to dev_pm_opp_put(). Fixes: 41907aa ("OPP: Level zero is valid") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 9251414 commit 19cc8b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/opp/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,8 @@ struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
808808
struct dev_pm_opp *opp;
809809

810810
opp = _find_key_ceil(dev, &temp, 0, true, _read_level, NULL);
811+
if (IS_ERR(opp))
812+
return opp;
811813

812814
/* False match */
813815
if (temp == OPP_LEVEL_UNSET) {

0 commit comments

Comments
 (0)