diff options
| author | Masahiro Yamada <[email protected]> | 2015-12-28 19:23:00 +0900 |
|---|---|---|
| committer | Stephen Boyd <[email protected]> | 2016-02-01 17:01:46 -0800 |
| commit | 176d11690ba2c8ad59f99734d692f19f451c408b (patch) | |
| tree | b2c077ce67c9946ccf87fed1ae1888761d2077bf /tools/perf/scripts/python/net_dropmonitor.py | |
| parent | 3a6e84545129913613dc1a97bbe8e4f2378696ee (diff) | |
clk: move core->parents allocation to clk_register()
Currently, __clk_core_init() allows failure of the kcalloc() for the
core->parents. So, clk_fetch_parent_index() and __clk_init_parent()
also try to allocate core->parents in case it has not been allocated
yet. Scattering memory allocation here and there makes things
complicated.
Like other clk_core members, allocate core->parents in clk_register()
and let it fail in case of memory shortage. If we cannot allocate
such a small piece of memory, the system is already insane. There is
no point to postpone the memory allocation.
Also, allocate core->parents regardless of core->num_parents. We want
it even if core->num_parents == 1 because clk_fetch_parent_index()
might be called against the clk_core with a single parent.
If core->num_parents == 0, core->parents is set to ZERO_SIZE_PTR. It
is harmless because no access happens to core->parents in such a case.
Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Vladimir Zapolskiy <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions