Re: [PATCH v2] smp: Fix a potential usage of stale nr_cpus

2020-07-19 Thread Thomas Gleixner
Muchun Song writes: > When the cmdline of "nr_cpus" is not valid, the @nr_cpu_ids is assigned > a stale value. The nr_cpus is only valid when get_option() return 1. So > check the return value to prevent this. > > Signed-off-by: Muchun Song > --- > changelog in v2: > 1) Rework the commit log. >

[PATCH v2] smp: Fix a potential usage of stale nr_cpus

2020-07-17 Thread Muchun Song
When the cmdline of "nr_cpus" is not valid, the @nr_cpu_ids is assigned a stale value. The nr_cpus is only valid when get_option() return 1. So check the return value to prevent this. Signed-off-by: Muchun Song --- changelog in v2: 1) Rework the commit log. 2) Rework the return value check.