diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-10-20 11:02:05 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-10-20 11:02:05 +0200 |
commit | ca4b9c3b743da39a6e0756a5c68edb35f6fc5e53 (patch) | |
tree | 95ce0819f92e25bc4d768ab13cee1f385a83a7b2 /drivers/base/node.c | |
parent | a30b85df7d599f626973e9cd3056fe755bd778e0 (diff) | |
parent | 275d34b82561e695339b782950d49c386169dae3 (diff) | |
download | linux-ca4b9c3b743da39a6e0756a5c68edb35f6fc5e53.tar.bz2 |
Merge branch 'perf/urgent' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/base/node.c')
-rw-r--r-- | drivers/base/node.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c index 3855902f2c5b..aae2402f3791 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -27,13 +27,21 @@ static struct bus_type node_subsys = { static ssize_t node_read_cpumap(struct device *dev, bool list, char *buf) { + ssize_t n; + cpumask_var_t mask; struct node *node_dev = to_node(dev); - const struct cpumask *mask = cpumask_of_node(node_dev->dev.id); /* 2008/04/07: buf currently PAGE_SIZE, need 9 chars per 32 bits. */ BUILD_BUG_ON((NR_CPUS/32 * 9) > (PAGE_SIZE-1)); - return cpumap_print_to_pagebuf(list, buf, mask); + if (!alloc_cpumask_var(&mask, GFP_KERNEL)) + return 0; + + cpumask_and(mask, cpumask_of_node(node_dev->dev.id), cpu_online_mask); + n = cpumap_print_to_pagebuf(list, buf, mask); + free_cpumask_var(mask); + + return n; } static inline ssize_t node_read_cpumask(struct device *dev, |