linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: tw9910: add missed clk_disable_unprepare() on failure path
@ 2018-12-29 21:35 Alexey Khoroshilov
  2018-12-30  9:49 ` Jacopo Mondi
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Khoroshilov @ 2018-12-29 21:35 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Jacopo Mondi
  Cc: Alexey Khoroshilov, linux-media, linux-kernel, ldv-project

If gpiod_get_optional() fails in tw9910_power_on(), clk is left undisabled.

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


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

end of thread, other threads:[~2018-12-30 11:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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