diff options
author | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2014-12-03 14:12:30 +0200 |
---|---|---|
committer | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2014-12-05 09:52:39 +0200 |
commit | 4b3a7cc81053c2ac93d9ea784d603ec56239fae7 (patch) | |
tree | 4685011f688175c150d3ebab073277961b10e560 /topology.c | |
parent | 574c417a397b96e65d33ddf49dcf70293f56b53e (diff) |
idlestat: Return error from inter() and intersection() on alloc fail
This patch changes the return value of inter() and intersection()
on allocation fail to ptrerror(). Previously the return value was
NULL, which under normal conditions indicates no overlap between
the two sets. Further cascading changes are made to callers of
these functions and the callers of callers etc.
Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
Diffstat (limited to 'topology.c')
-rw-r--r-- | topology.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -437,13 +437,24 @@ int establish_idledata_to_topo(struct cpuidle_datas *datas) return -1; list_for_each_entry(s_phy, &g_cpu_topo_list.physical_head, - list_physical) - list_for_each_entry(s_core, &s_phy->core_head, list_core) + list_physical) { + list_for_each_entry(s_core, &s_phy->core_head, list_core) { s_core->cstates = core_cluster_data(s_core); + if (is_err(s_core->cstates)) { + s_core->cstates = NULL; + return -1; + } + } + } list_for_each_entry(s_phy, &g_cpu_topo_list.physical_head, - list_physical) + list_physical) { s_phy->cstates = physical_cluster_data(s_phy); + if (is_err(s_phy->cstates)) { + s_phy->cstates = NULL; + return -1; + } + } return 0; } |