Skip to contentSkip to conversation

rtc: rv3032: fix error handling in rv3032_clkout_set_rate()

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 12, 2021 – Oct 15, 2021

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

PATCH v2 1/1 rtc: rv3032: fix error handling in rv3032_clkout_set_rate()

Do not call rv3032_exit_eerd() if the enter function fails but don't forget to call the exit when the enter succeeds.

Fixes 2eeaa532acca ("rtc: rv3032: Add a driver for Microcrystal RV-3032")

---
v2: Fix a type in the commit message

 drivers/rtc/rtc-rv3032.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-rv3032.c +2 -2
index d63102d5cb1e..1b62ed2f1459 100644
@@ -617,11 +617,11 @@ static int rv3032_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
 
 	ret = rv3032_enter_eerd(rv3032, &eerd);
 	if (ret)
-		goto exit_eerd;
+		return ret;
 
 	ret = regmap_write(rv3032->regmap, RV3032_CLKOUT1, hfd & 0xff);
 	if (ret)
-		return ret;
+		goto exit_eerd;
 
 	ret = regmap_write(rv3032->regmap, RV3032_CLKOUT2, RV3032_CLKOUT2_OS |
 			    FIELD_PREP(RV3032_CLKOUT2_HFD_MSK, hfd >> 8));
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Dan Carpenter

Do not call rv3032_exit_eerd() if the enter function fails but don't forget to call the exit when the enter succeeds.

Applied, thanks!

[1/1] rtc: rv3032: fix error handling in rv3032_clkout_set_rate()

      commit: c3336b8ac6091df60a5c1049a8c685d0b947cc61

Best regards,

Signature · 1 line
Alexandre Belloni <[email protected]>