Commit 080e0b74 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Mauro Carvalho Chehab

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: 73dcffeb ("media: i2c: Support 19.2MHz input clock in ov8865")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 54bb7671
...@@ -3034,11 +3034,13 @@ static int ov8865_probe(struct i2c_client *client) ...@@ -3034,11 +3034,13 @@ static int ov8865_probe(struct i2c_client *client)
&rate); &rate);
if (!ret && sensor->extclk) { if (!ret && sensor->extclk) {
ret = clk_set_rate(sensor->extclk, rate); ret = clk_set_rate(sensor->extclk, rate);
if (ret) if (ret) {
return dev_err_probe(dev, ret, dev_err_probe(dev, ret, "failed to set clock rate\n");
"failed to set clock rate\n"); goto error_endpoint;
}
} else if (ret && !sensor->extclk) { } 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); sensor->extclk_rate = rate ? rate : clk_get_rate(sensor->extclk);
......
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