Skip to content

Commit bb42b7e

Browse files
Yang Yingliangalexandrebelloni
authored andcommitted
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: f8176e0 ("rtc: rv8803: initialize registers on post-probe voltage loss") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Sascha Hauer <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 07dcc6f commit bb42b7e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/rtc/rtc-rv8803.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,10 @@ static int rv8803_set_time(struct device *dev, struct rtc_time *tm)
315315

316316
if (flags & RV8803_FLAG_V2F) {
317317
ret = rv8803_regs_reset(rv8803);
318-
if (ret)
318+
if (ret) {
319+
mutex_unlock(&rv8803->flags_lock);
319320
return ret;
321+
}
320322
}
321323

322324
ret = rv8803_write_reg(rv8803->client, RV8803_FLAG,

0 commit comments

Comments
 (0)