summaryrefslogtreecommitdiff
path: root/fs/userfaultfd.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2018-01-23 23:43:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-26 12:02:18 +0300
commit4b95781cb6f37398e424e70e089e380f297693f5 (patch)
tree12e67e8313fe08df6756cb6b3bd6a5e3b14f8137 /fs/userfaultfd.c
parent05e52e5bd103a335288415d5399cdb120a05a5e4 (diff)
downloadlinux-4b95781cb6f37398e424e70e089e380f297693f5.tar.xz
PM / domains: Fix up domain-idle-states OF parsing
[ Upstream commit a3381e3a65cbaf612c8f584906c4dba27e84267c ] Commit b539cc82d493 (PM / Domains: Ignore domain-idle-states that are not compatible), made it possible to ignore non-compatible domain-idle-states OF nodes. However, in case that happens while doing the OF parsing, the number of elements in the allocated array would exceed the numbers actually needed, thus wasting memory. Fix this by pre-iterating the genpd OF node and counting the number of compatible domain-idle-states nodes, before doing the allocation. While doing this, it makes sense to rework the code a bit to avoid open coding, of parts responsible for the OF node iteration. Let's also take the opportunity to clarify the function header for of_genpd_parse_idle_states(), about what is being returned in case of errors. Fixes: b539cc82d493 (PM / Domains: Ignore domain-idle-states that are not compatible) Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Lina Iyer <ilina@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/userfaultfd.c')
0 files changed, 0 insertions, 0 deletions