Skip to content

Commit d86a2f0

Browse files
committed
OPP: Fix missing cleanup on error in _opp_attach_genpd()
A recent commit updated the code mistakenly to return directly on errors, without doing the required cleanups. Fix it. Fixes: 2a56c46 ("OPP: Fix required_opp_tables for multiple genpds using same table") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Viresh Kumar <[email protected]>
1 parent 1613e60 commit d86a2f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/opp/core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,8 +2443,10 @@ static int _opp_attach_genpd(struct opp_table *opp_table, struct device *dev,
24432443
* Cross check it again and fix if required.
24442444
*/
24452445
gdev = dev_to_genpd_dev(virt_dev);
2446-
if (IS_ERR(gdev))
2447-
return PTR_ERR(gdev);
2446+
if (IS_ERR(gdev)) {
2447+
ret = PTR_ERR(gdev);
2448+
goto err;
2449+
}
24482450

24492451
genpd_table = _find_opp_table(gdev);
24502452
if (!IS_ERR(genpd_table)) {

0 commit comments

Comments
 (0)