Skip to content

Commit

Permalink
media: tw9910: fix failure handling in tw9910_power_on()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
khoroshilov authored and mchehab committed Jan 16, 2019
1 parent 49710c3 commit d6b10dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/media/i2c/tw9910.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit d6b10dd

Please sign in to comment.