diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2018-12-30 06:41:40 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-01-16 11:29:31 -0500 |
commit | d6b10dd0017641fee31daa84e478708a33d2f00a (patch) | |
tree | ce75c71bcbfa09838e352483aef79c2fe20a1642 | |
parent | 49710c32cd9d6626a77c9f5f978a5f58cb536b35 (diff) | |
download | linux-d6b10dd0017641fee31daa84e478708a33d2f00a.tar.gz linux-d6b10dd0017641fee31daa84e478708a33d2f00a.tar.bz2 linux-d6b10dd0017641fee31daa84e478708a33d2f00a.zip |
media: tw9910: fix failure handling in tw9910_power_on()
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | drivers/media/i2c/tw9910.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/i2c/tw9910.c b/drivers/media/i2c/tw9910.c index a54548cc4285..0971f8a34afb 100644 --- a/drivers/media/i2c/tw9910.c +++ b/drivers/media/i2c/tw9910.c @@ -610,6 +610,11 @@ 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); + if (priv->pdn_gpio) { + gpiod_set_value(priv->pdn_gpio, 1); + usleep_range(500, 1000); + } return PTR_ERR(priv->rstb_gpio); } |