diff options
| author | Jacopo Mondi <[email protected]> | 2023-02-09 21:12:35 +0100 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2023-03-20 15:55:45 +0100 |
| commit | e004c637fb1d4b975d476f800675ec18c9502cc9 (patch) | |
| tree | 799282c61d3017af28b71739346fdae5db8208c0 /tools/perf/scripts/python | |
| parent | bdcf6267b851471865cbd5938442ed7c76bf1bf9 (diff) | |
media: i2c: ov5670: Properly handle !CONFIG_HAVE_CLK
The ov5670 driver tries to get a reference to the xvclk provider by using
the common cock framework and deflects to parsing the "clock-frequency"
property in case the clock provider is not specified in the firmware
interface, detected by checking if ov5670->xvclk == PTR_ERR(-ENOENT).
However, as reported by the Smatch static checker, if CONFIG_HAVE_CLK is
not enabled, devm_clk_get() returns 0 which when passed to PTR_ERR()
means success causing the driver to fail without propagating any error
code up.
Explicitly handle the case where ov5670->xvclk it set to NULL, forcing
the code to parse the "clock-frequency" property in case CONFIG_HAVE_CLK
is not enabled, as suggested by Dan Carpenter.
Reported-by: Dan Carpenter <[email protected]>
Suggested-by: Dan Carpenter <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions