summaryrefslogtreecommitdiffstats
path: root/drivers/opp
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2023-11-28 08:01:38 +0100
committerViresh Kumar <viresh.kumar@linaro.org>2023-11-28 11:33:37 +0100
commit19cc8b1819a40410c50a3efab6cf27b73298deb5 (patch)
tree02e22eb02583c78f4e964c9b819b037880709733 /drivers/opp
parentOPP: Don't set OPP recursively for a parent genpd (diff)
downloadlinux-19cc8b1819a40410c50a3efab6cf27b73298deb5.tar.xz
linux-19cc8b1819a40410c50a3efab6cf27b73298deb5.zip
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: 41907aa4ae37 ("OPP: Level zero is valid") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp')
-rw-r--r--drivers/opp/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 4f1ca84d9ed0..c022d548067d 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -808,6 +808,8 @@ struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
struct dev_pm_opp *opp;
opp = _find_key_ceil(dev, &temp, 0, true, _read_level, NULL);
+ if (IS_ERR(opp))
+ return opp;
/* False match */
if (temp == OPP_LEVEL_UNSET) {