2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 22:53:55 +08:00

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>
This commit is contained in:
Alexey Khoroshilov 2018-12-30 06:41:40 -05:00 committed by Mauro Carvalho Chehab
parent 49710c32cd
commit d6b10dd001

View File

@ -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);
}