Commit 1d18c2cd authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Mauro Carvalho Chehab

media: ov772x: Disable clk on error path

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 1526dbeb
...@@ -864,6 +864,7 @@ static int ov772x_power_on(struct ov772x_priv *priv) ...@@ -864,6 +864,7 @@ static int ov772x_power_on(struct ov772x_priv *priv)
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(priv->rstb_gpio)) { if (IS_ERR(priv->rstb_gpio)) {
dev_info(&client->dev, "Unable to get GPIO \"reset\""); dev_info(&client->dev, "Unable to get GPIO \"reset\"");
clk_disable_unprepare(priv->clk);
return PTR_ERR(priv->rstb_gpio); return PTR_ERR(priv->rstb_gpio);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment