Skip to contentSkip to conversation

rtc: rv8803: fix missing unlock on error in rv8803_set_time()

PATCH Applied Yang Yingliang 2 participants 2 messages Jun 27, 2022 – Jul 26, 2022 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rtc: rv8803: fix missing unlock on error in rv8803_set_time()

Add the missing unlock before return from function rv8803_set_time() in the error handling case.

Fixes f8176e0bb83f ("rtc: rv8803: initialize registers on post-probe voltage loss")

---
v2:
correct fix tag.

---
 drivers/rtc/rtc-rv8803.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/rtc/rtc-rv8803.c +3 -1
index fe1247e771b9..3527a0521e9b 100644
@@ -315,8 +315,10 @@ static int rv8803_set_time(struct device *dev, struct rtc_time *tm)
 
 	if (flags & RV8803_FLAG_V2F) {
 		ret = rv8803_regs_reset(rv8803);
-		if (ret)
+		if (ret) {
+			mutex_unlock(&rv8803->flags_lock);
 			return ret;
+		}
 	}
 
 	ret = rv8803_write_reg(rv8803->client, RV8803_FLAG,
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Yang Yingliang

Add the missing unlock before return from function rv8803_set_time() in the error handling case.

Applied, thanks!

[1/1] rtc: rv8803: fix missing unlock on error in rv8803_set_time()

      commit: bb42b7e9e30e7a07b7cb6790a22dc758b0dc123e

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com