]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
OPP: Move break out of scoped_guard in dev_pm_opp_xlate_required_opp()
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 23 Feb 2026 05:35:59 +0000 (11:05 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Mon, 23 Feb 2026 05:35:59 +0000 (11:05 +0530)
The commit ff9c512041f2 ("OPP: Use mutex locking guards")
unintentionally made the for loop run longer than required.

scoped_guard() is implemented as a for loop. The break statement now
breaks out out the scoped_guard() and not out of the outer for loop.
The outer loop always iterates to completion.

Fix it.

Fixes: ff9c512041f2 ("OPP: Use mutex locking guards")
Reported-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/opp/core.c

index 866641666e410cf0bef379351f6cee2a39ef30a4..da3f5eba434197475938981f7031b6ca6a698dd7 100644 (file)
@@ -2742,8 +2742,8 @@ struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_table,
                                        break;
                                }
                        }
-                       break;
                }
+               break;
        }
 
        if (IS_ERR(dest_opp)) {