diff --git a/sys/arm64/freescale/imx/clk/imx_clk_composite.c b/sys/arm64/freescale/imx/clk/imx_clk_composite.c --- a/sys/arm64/freescale/imx/clk/imx_clk_composite.c +++ b/sys/arm64/freescale/imx/clk/imx_clk_composite.c @@ -217,6 +217,7 @@ p_names = clknode_get_parent_names(clk); best_diff = 0; + best_parent = -1; for (p_idx = 0; p_idx != clknode_get_parents_num(clk); p_idx++) { p_clk = clknode_find_by_name(p_names[p_idx]); @@ -243,6 +244,10 @@ if (best_diff == INT64_MAX) return (ERANGE); + /* If we didn't find a new best_parent just return */ + if (best_parent == -1) + return (0); + if ((flags & CLK_SET_DRYRUN) != 0) { *fout = best; return (0);