aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2022-08-07 08:43:29 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-09-24 09:05:49 +0200
commit080e0b7404850406628674b07286f16cc389a892 (patch)
tree5b338d125e657e7f30ee2761c0c35f7684179c5d /drivers/media
parentmedia: ar0521: Fix return value check in writing initial registers (diff)
downloadwireguard-linux-080e0b7404850406628674b07286f16cc389a892.tar.xz
wireguard-linux-080e0b7404850406628674b07286f16cc389a892.zip
media: ov8865: Fix an error handling path in ov8865_probe()
The commit in Fixes also introduced some new error handling which should goto the existing error handling path. Otherwise some resources leak. Fixes: 73dcffeb2ff9 ("media: i2c: Support 19.2MHz input clock in ov8865") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/ov8865.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/i2c/ov8865.c b/drivers/media/i2c/ov8865.c
index b8f4f0d3e33d..15d0f79231dd 100644
--- a/drivers/media/i2c/ov8865.c
+++ b/drivers/media/i2c/ov8865.c
@@ -3034,11 +3034,13 @@ static int ov8865_probe(struct i2c_client *client)
&rate);
if (!ret && sensor->extclk) {
ret = clk_set_rate(sensor->extclk, rate);
- if (ret)
- return dev_err_probe(dev, ret,
- "failed to set clock rate\n");
+ if (ret) {
+ dev_err_probe(dev, ret, "failed to set clock rate\n");
+ goto error_endpoint;
+ }
} else if (ret && !sensor->extclk) {
- return dev_err_probe(dev, ret, "invalid clock config\n");
+ dev_err_probe(dev, ret, "invalid clock config\n");
+ goto error_endpoint;
}
sensor->extclk_rate = rate ? rate : clk_get_rate(sensor->extclk);