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>
This commit is contained in:
parent
54bb7671ca
commit
080e0b7404
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user