diff --git a/net/lnet/libcfs/libcfs_cpu.c b/net/lnet/libcfs/libcfs_cpu.c index 80533c2..20ca15a 100644 --- a/net/lnet/libcfs/libcfs_cpu.c +++ b/net/lnet/libcfs/libcfs_cpu.c @@ -913,7 +913,7 @@ static struct cfs_cpt_table *cfs_cpt_table_create(int ncpt) int ncpu = cpumask_weight(part->cpt_cpumask); rc = cfs_cpt_choose_ncpus(cptab, cpt, node_mask, - num - ncpu); + (rem > 0) + num - ncpu); if (rc < 0) { rc = -EINVAL; goto failed_mask;