public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: ov772x: Disable clk on error path
@ 2018-08-15 20:10 Alexey Khoroshilov
  2018-08-16 10:13 ` jacopo mondi
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Khoroshilov @ 2018-08-15 20:10 UTC (permalink / raw)
  To: Jacopo Mondi, Mauro Carvalho Chehab
  Cc: Alexey Khoroshilov, linux-media, linux-kernel, ldv-project

If ov772x_power_on() is unable to get GPIO rstb,
the clock is left undisabled.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
 drivers/media/i2c/ov772x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c
index e2550708abc8..7b62bf1fc5b1 100644
--- a/drivers/media/i2c/ov772x.c
+++ b/drivers/media/i2c/ov772x.c
@@ -828,6 +828,7 @@ static int ov772x_power_on(struct ov772x_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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: ov772x: Disable clk on error path
  2018-08-15 20:10 [PATCH] media: ov772x: Disable clk on error path Alexey Khoroshilov
@ 2018-08-16 10:13 ` jacopo mondi
  0 siblings, 0 replies; 2+ messages in thread
From: jacopo mondi @ 2018-08-16 10:13 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, ldv-project

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

Hello Alexey,
   thanks for the patch

On Wed, Aug 15, 2018 at 11:10:39PM +0300, Alexey Khoroshilov wrote:
> If ov772x_power_on() is unable to get GPIO rstb,
> the clock is left undisabled.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>

Acked-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>

Thanks
   j

> ---
>  drivers/media/i2c/ov772x.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c
> index e2550708abc8..7b62bf1fc5b1 100644
> --- a/drivers/media/i2c/ov772x.c
> +++ b/drivers/media/i2c/ov772x.c
> @@ -828,6 +828,7 @@ static int ov772x_power_on(struct ov772x_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: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-16 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-15 20:10 [PATCH] media: ov772x: Disable clk on error path Alexey Khoroshilov
2018-08-16 10:13 ` jacopo mondi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox