Skip to contentSkip to conversation

clk: renesas: r9a06g032: Repair grave increment error

PATCH New Marek Vasut 2 participants 2 messages Oct 28, 2022 – Oct 31, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clk: renesas: r9a06g032: Repair grave increment error

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

Fixes aad03a66f902 ("clk: renesas: r9a06g032: Add clock domain support")

---
Cc: Gareth Williams <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Ralph Siemsen <[email protected]>
---
V2: - Drop Phil, add Gareth
- Add Fixes tag
- Add RB from Geert, Ralph

---
 drivers/clk/renesas/r9a06g032-clocks.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/renesas/r9a06g032-clocks.c +1 -2
index 1488c9d6e6394..983faa5707b9c 100644
@@ -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;
@@ -425,7 +425,6 @@ static int r9a06g032_attach_dev(struct generic_pm_domain *pd,
 			if (error)
 				return error;
 		}
-		i++;
 	}
 
 	return 0;
Signature · 1 line
2.35.1
#1 lore raw

PATCH v2 1/1 clk: renesas: r9a06g032: Repair grave increment error

Hi Marek,

Quoted 3 lines · Marek Vasut

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

Thanks for the patch, this looks correct to me.

Best Regards,

Gareth

Quoted 44 lines
Fixes aad03a66f902 ("clk: renesas: r9a06g032: Add clock domain support")

---
Cc: Gareth Williams <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Ralph Siemsen <[email protected]>
---
V2: - Drop Phil, add Gareth
- Add Fixes tag
- Add RB from Geert, Ralph

---
 drivers/clk/renesas/r9a06g032-clocks.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/renesas/r9a06g032-clocks.c +1 -1
index 1488c9d6e6394..983faa5707b9c 100644
@@ -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)) {
drivers/clk/renesas/r9a06g032-clocks.c +0 -1
 		if (clkspec.np != pd->dev.of_node)
 			continue;
@@ -425,7 +425,6 @@ static int r9a06g032_attach_dev(struct
 generic_pm_domain *pd,
 			if (error)
 				return error;
 		}
-		i++;
 	}
 

return 0;
--
2.35.1