|
|
@@ -2437,7 +2437,8 @@ static int __clk_init(struct device *dev, struct clk *clk_user)
|
|
|
hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) {
|
|
|
if (orphan->num_parents && orphan->ops->get_parent) {
|
|
|
i = orphan->ops->get_parent(orphan->hw);
|
|
|
- if (!strcmp(core->name, orphan->parent_names[i]))
|
|
|
+ if (i >= 0 && i < orphan->num_parents &&
|
|
|
+ !strcmp(core->name, orphan->parent_names[i]))
|
|
|
clk_core_reparent(orphan, core);
|
|
|
continue;
|
|
|
}
|