All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: rv3032: fix error handling in rv3032_clkout_set_rate()
@ 2021-10-12  8:25 Dan Carpenter
  2021-10-12 10:07 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-10-12  8:25 UTC (permalink / raw)
  To: Alessandro Zummo; +Cc: Alexandre Belloni, linux-rtc, kernel-janitors

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

Fixes: 2eeaa532acca ("rtc: rv3032: Add a driver for Microcrystal RV-3032")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/rtc/rtc-rv3032.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-rv3032.c b/drivers/rtc/rtc-rv3032.c
index d63102d5cb1e..1b62ed2f1459 100644
--- a/drivers/rtc/rtc-rv3032.c
+++ b/drivers/rtc/rtc-rv3032.c
@@ -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));
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtc: rv3032: fix error handling in rv3032_clkout_set_rate()
  2021-10-12  8:25 [PATCH] rtc: rv3032: fix error handling in rv3032_clkout_set_rate() Dan Carpenter
@ 2021-10-12 10:07 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2021-10-12 10:07 UTC (permalink / raw)
  To: Alessandro Zummo; +Cc: Alexandre Belloni, linux-rtc, kernel-janitors

On Tue, Oct 12, 2021 at 11:25:48AM +0300, Dan Carpenter wrote:
> Do not call rv3032_exit_eerd() if the enter function fails but don't
> forget to call the exit on if the enter succeeds.
                          ^^^^^
Let me resend... :/

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-12 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12  8:25 [PATCH] rtc: rv3032: fix error handling in rv3032_clkout_set_rate() Dan Carpenter
2021-10-12 10:07 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.