mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo@jmondi.org>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
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 10:49:27 +0100	[thread overview]
Message-ID: <20181230094918.6ysahn7tr6us6uoh@uno.localdomain> (raw)
In-Reply-To: <1546119320-11841-1-git-send-email-khoroshilov@ispras.ru>

[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]

Hi Alexey,
   thanks for the patch

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?

Thanks
  j

> 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
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-12-30  9:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29 21:35 Alexey Khoroshilov
2018-12-30  9:49 ` Jacopo Mondi [this message]
2018-12-30 11:17   ` Alexey Khoroshilov
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=20181230094918.6ysahn7tr6us6uoh@uno.localdomain \
    --to=jacopo@jmondi.org \
    --cc=jacopo+renesas@jmondi.org \
    --cc=khoroshilov@ispras.ru \
    --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

all inboxes | Powered by JetHome®