9
0
Fork 0

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:
Lucas Stach 2014-02-07 09:48:55 +01:00 committed by Sascha Hauer
parent 40fa265fab
commit b0723e39ec
1 changed files with 5 additions and 3 deletions

View File

@ -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);
}