From: Sascha Hauer <s.hauer@pengutronix.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
Ahmad Fatoum <a.fatoum@pengutronix.de>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] rtc: rv8803: unlock on error path in rv8803_set_time()
Date: Tue, 28 Jun 2022 09:05:40 +0200 [thread overview]
Message-ID: <20220628070540.GI19026@pengutronix.de> (raw)
In-Reply-To: <YrqmpT873Y99+a2d@kili>
Hi Dan,
On Tue, Jun 28, 2022 at 09:58:45AM +0300, Dan Carpenter wrote:
> Call mutex_unlock(&rv8803->flags_lock) before returning if
> rv8803_regs_reset() fails.
>
> Fixes: f8176e0bb83f ("rtc: rv8803: initialize registers on post-probe voltage loss")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/rtc/rtc-rv8803.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
A fix for this is already posted here:
https://lore.kernel.org/lkml/20220627080822.3881072-1-yangyingliang@huawei.com/
Sascha
>
> diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
> index fe1247e771b9..3527a0521e9b 100644
> --- a/drivers/rtc/rtc-rv8803.c
> +++ b/drivers/rtc/rtc-rv8803.c
> @@ -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,
> --
> 2.35.1
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2022-06-28 7:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 6:58 [PATCH] rtc: rv8803: unlock on error path in rv8803_set_time() Dan Carpenter
2022-06-28 7:05 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220628070540.GI19026@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.