提交 508f884a 编写于 作者: M Masahiro Yamada 提交者: Stephen Boyd

clk: make sure parent is not NULL in clk_fetch_parent_index()

If parent is given with NULL, clk_fetch_parent_index() could return
a positive index value.

Currently, parent is checked by the callers of this function, but
it would be safer to do it in this function.
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: NVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
上级 0e8f6e49
......@@ -1066,6 +1066,9 @@ static int clk_fetch_parent_index(struct clk_core *core,
{
int i;
if (!parent)
return -EINVAL;
/*
* find index of new parent clock using cached parent ptrs,
* or if not yet cached, use string name comparison and cache
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册