summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorPetr Cvek <petrcvekcz@gmail.com>2018-12-13 10:39:19 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-01-16 13:32:09 -0500
commitffe305d261f4d96eb851f1cad860d845edfaef25 (patch)
treecfffe78310378ccb854c3b1f9b24562fb4701241 /drivers/media/i2c
parent95531e462288a9afdcb494abf6d1d123f5a4ff1c (diff)
downloadlinux-ffe305d261f4d96eb851f1cad860d845edfaef25.tar.bz2
media: i2c: ov9640: fix missing error handling in probe
Control handlers registration lacked error path with v4l2_ctrl_handler_free() call. Fix it by using goto to alread existing v4l2_ctrl_handler_free() call. Signed-off-by: Petr Cvek <petrcvekcz@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/ov9640.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/media/i2c/ov9640.c b/drivers/media/i2c/ov9640.c
index 9739fa8d433a..c183273fd332 100644
--- a/drivers/media/i2c/ov9640.c
+++ b/drivers/media/i2c/ov9640.c
@@ -710,14 +710,18 @@ static int ov9640_probe(struct i2c_client *client,
V4L2_CID_VFLIP, 0, 1, 1, 0);
v4l2_ctrl_new_std(&priv->hdl, &ov9640_ctrl_ops,
V4L2_CID_HFLIP, 0, 1, 1, 0);
+
+ if (priv->hdl.error) {
+ ret = priv->hdl.error;
+ goto ectrlinit;
+ }
+
priv->subdev.ctrl_handler = &priv->hdl;
- if (priv->hdl.error)
- return priv->hdl.error;
priv->clk = v4l2_clk_get(&client->dev, "mclk");
if (IS_ERR(priv->clk)) {
ret = PTR_ERR(priv->clk);
- goto eclkget;
+ goto ectrlinit;
}
ret = ov9640_video_probe(client);
@@ -733,7 +737,7 @@ static int ov9640_probe(struct i2c_client *client,
eprobe:
v4l2_clk_put(priv->clk);
-eclkget:
+ectrlinit:
v4l2_ctrl_handler_free(&priv->hdl);
return ret;