summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2018-08-15 23:10:39 +0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-31 16:24:52 +0300
commit1d18c2cd9d38ad639b2e00546b9ee638f2cef4b0 (patch)
tree8a5c89150960de016d5ebb434de243579aebc7a6
parent1526dbeb54f202e9fa2de660fd18030ebaa99f49 (diff)
downloadlinux-1d18c2cd9d38ad639b2e00546b9ee638f2cef4b0.tar.xz
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: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--drivers/media/i2c/ov772x.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c
index 0d3ed23798a0..161bc7c8535d 100644
--- a/drivers/media/i2c/ov772x.c
+++ b/drivers/media/i2c/ov772x.c
@@ -864,6 +864,7 @@ static int ov772x_power_on(struct ov772x_priv *priv)
GPIOD_OUT_LOW);
if (IS_ERR(priv->rstb_gpio)) {
dev_info(&client->dev, "Unable to get GPIO \"reset\"");
+ clk_disable_unprepare(priv->clk);
return PTR_ERR(priv->rstb_gpio);
}