From: Alexey Khoroshilov <khoroshilov@ispras.ru>
To: Jacopo Mondi <jacopo@jmondi.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Jacopo Mondi <jacopo+renesas@jmondi.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
ldv-project@linuxtesting.org
Subject: Re: [PATCH] media: tw9910: add missed clk_disable_unprepare() on failure path
Date: Sun, 30 Dec 2018 14:17:54 +0300 [thread overview]
Message-ID: <80f84853-9991-8a64-da22-9349543d5deb@ispras.ru> (raw)
In-Reply-To: <20181230094918.6ysahn7tr6us6uoh@uno.localdomain>
Hi Jacopo,
On 30.12.2018 12:49, Jacopo Mondi wrote:
> On Sun, Dec 30, 2018 at 12:35:20AM +0300, Alexey Khoroshilov wrote:
>> If gpiod_get_optional() fails in tw9910_power_on(), clk is left undisabled.
>
> Correct, thanks for spotting this.
>
> I think pdn_gpio should also be handled if rstb_gpio fails.
> What's your opinion?
I would agree. I'll send v2.
Thank you,
Alexey
>
>> Found by Linux Driver Verification project (linuxtesting.org).
>>
>> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
>> ---
>> drivers/media/i2c/tw9910.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/media/i2c/tw9910.c b/drivers/media/i2c/tw9910.c
>> index a54548cc4285..109770d678d2 100644
>> --- a/drivers/media/i2c/tw9910.c
>> +++ b/drivers/media/i2c/tw9910.c
>> @@ -610,6 +610,7 @@ static int tw9910_power_on(struct tw9910_priv *priv)
>> GPIOD_OUT_LOW);
>> if (IS_ERR(priv->rstb_gpio)) {
>> dev_info(&client->dev, "Unable to get GPIO \"rstb\"");
>> + clk_disable_unprepare(priv->clk);
>> return PTR_ERR(priv->rstb_gpio);
>> }
>>
>> --
>> 2.7.4
>>
next prev parent reply other threads:[~2018-12-30 11:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-29 21:35 [PATCH] media: tw9910: add missed clk_disable_unprepare() on failure path Alexey Khoroshilov
2018-12-30 9:49 ` Jacopo Mondi
2018-12-30 11:17 ` Alexey Khoroshilov [this message]
2018-12-30 11:41 ` [PATCH v2 1/2] media: tw9910: fix failure handling in tw9910_power_on() Alexey Khoroshilov
2018-12-30 11:41 ` [PATCH v2 2/2] media: tw9910: add helper function for setting gpiod value Alexey Khoroshilov
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=80f84853-9991-8a64-da22-9349543d5deb@ispras.ru \
--to=khoroshilov@ispras.ru \
--cc=jacopo+renesas@jmondi.org \
--cc=jacopo@jmondi.org \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).