cpumask_of_node can return NULL if NUMA node is unavailable,
in this case cfs_node_to_cpumask will try to copy from NULL
and cause kernel panic.
Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Change-Id: Ia866c80a5cf5eaba76e392daa77a572fd427d18c
Reviewed-on: http://review.whamcloud.com/13207
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
void
cfs_node_to_cpumask(int node, cpumask_t *mask)
{
- cpumask_copy(mask, cpumask_of_node(node));
+ const cpumask_t *tmp = cpumask_of_node(node);
+
+ if (tmp != NULL)
+ cpumask_copy(mask, tmp);
+ else
+ cpumask_clear(mask);
}
EXPORT_SYMBOL(cfs_node_to_cpumask);