Skip to content

Commit 7b9d621

Browse files
committed
OPP: fix error code in dev_pm_opp_set_config()
JIRA: https://issues.redhat.com/browse/RHEL-81536 commit eb83336 Author: Dan Carpenter <dan.carpenter@linaro.org> Date: Mon Sep 16 17:07:26 2024 +0300 This is an error path so set the error code. Smatch complains about the current code: drivers/opp/core.c:2660 dev_pm_opp_set_config() error: uninitialized symbol 'ret'. Fixes: e37440e ("OPP: Call dev_pm_opp_set_opp() for required OPPs") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/3f3660af-4ea0-4a89-b3b7-58de7b16d7a5@stanley.mountain Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent bbf8104 commit 7b9d621

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/opp/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2666,8 +2666,10 @@ int dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config)
26662666

26672667
/* Attach genpds */
26682668
if (config->genpd_names) {
2669-
if (config->required_devs)
2669+
if (config->required_devs) {
2670+
ret = -EINVAL;
26702671
goto err;
2672+
}
26712673

26722674
ret = _opp_attach_genpd(opp_table, dev, config->genpd_names,
26732675
config->virt_devs);

0 commit comments

Comments
 (0)