clk: avoid possible NULL ptr deref
Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
40fa265fab
commit
b0723e39ec
|
@ -179,9 +179,11 @@ struct clk *clk_get(struct device_d *dev, const char *con_id)
|
|||
if (!IS_ERR(clk))
|
||||
return clk;
|
||||
|
||||
clk = of_clk_get_by_name(dev->device_node, con_id);
|
||||
if (!IS_ERR(clk))
|
||||
return clk;
|
||||
if (dev) {
|
||||
clk = of_clk_get_by_name(dev->device_node, con_id);
|
||||
if (!IS_ERR(clk))
|
||||
return clk;
|
||||
}
|
||||
|
||||
return clk_get_sys(dev_id, con_id);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue