Assigned clocks: fix off-by-one bug, don't leak allocated memory.
MFC after: 1 week
This commit is contained in:
parent
6e9862526a
commit
a9be5d7515
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363122
@ -1420,15 +1420,17 @@ clk_set_assigned(device_t dev, phandle_t node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* First set it's parent if needed */
|
/* First set it's parent if needed */
|
||||||
if (i <= nparents)
|
if (i < nparents)
|
||||||
clk_set_assigned_parent(dev, clk, i);
|
clk_set_assigned_parent(dev, clk, i);
|
||||||
|
|
||||||
/* Then set a new frequency */
|
/* Then set a new frequency */
|
||||||
if (i <= nrates && rates[i] != 0)
|
if (i < nrates && rates[i] != 0)
|
||||||
clk_set_assigned_rates(dev, clk, rates[i]);
|
clk_set_assigned_rates(dev, clk, rates[i]);
|
||||||
|
|
||||||
clk_release(clk);
|
clk_release(clk);
|
||||||
}
|
}
|
||||||
|
if (rates != NULL)
|
||||||
|
OF_prop_free(rates);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user