Skip to content

Commit

Permalink
clk: renesas: r9a06g032: Repair grave increment error
Browse files Browse the repository at this point in the history
[ Upstream commit 02693e1 ]

If condition (clkspec.np != pd->dev.of_node) is true, then the driver
ends up in an endless loop, forever, locking up the machine.

Fixes: aad03a6 ("clk: renesas: r9a06g032: Add clock domain support")
Reviewed-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Gareth Williams <gareth.williams.jx@renesas.com>
Link: https://lore.kernel.org/r/20221028113834.7496-1-marex@denx.de
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Marek Vasut authored and gregkh committed Dec 31, 2022
1 parent bd449ca commit 521dc06
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/clk/renesas/r9a06g032-clocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ static int r9a06g032_attach_dev(struct generic_pm_domain *pd,
int error;
int index;

while (!of_parse_phandle_with_args(np, "clocks", "#clock-cells", i,
while (!of_parse_phandle_with_args(np, "clocks", "#clock-cells", i++,
&clkspec)) {
if (clkspec.np != pd->dev.of_node)
continue;
Expand All @@ -425,7 +425,6 @@ static int r9a06g032_attach_dev(struct generic_pm_domain *pd,
if (error)
return error;
}
i++;
}

return 0;
Expand Down

0 comments on commit 521dc06

Please sign in to comment.