mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 12:46:14 +02:00
clk: versaclock: Use IS_ERR check before dereference
In versaclock_probe vc5->pin_xin may be an error pointer so need to check with IS_ERR before attempting to dereference it. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
This commit is contained in:
parent
6f48f6f2a2
commit
2a13b59ed4
@ -904,12 +904,12 @@ int versaclock_probe(struct udevice *dev)
|
||||
if (IS_ERR(mux_name))
|
||||
return PTR_ERR(mux_name);
|
||||
|
||||
clk_register(&vc5->clk_mux, "versaclock-mux", mux_name, vc5->pin_xin->dev->name);
|
||||
|
||||
if (!IS_ERR(vc5->pin_xin))
|
||||
if (!IS_ERR(vc5->pin_xin)) {
|
||||
clk_register(&vc5->clk_mux, "versaclock-mux", mux_name, vc5->pin_xin->dev->name);
|
||||
vc5_mux_set_parent(&vc5->clk_mux, 1);
|
||||
else
|
||||
} else {
|
||||
vc5_mux_set_parent(&vc5->clk_mux, 0);
|
||||
}
|
||||
|
||||
/* Configure Optional Loading Capacitance for external XTAL */
|
||||
if (!(vc5->chip_info->flags & VC5_HAS_INTERNAL_XTAL)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user