Without locking out CPU mask operations we might end up with an inconsistent view of the cpumask in the function.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -39,6 +39,7 @@ struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs) · 38 unmodified lines | ||
| 39 | 39 | return NULL; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | + get_online_cpus(); | |
| 42 | 43 | if (max_vecs >= num_online_cpus()) { |
| 43 | 44 | cpumask_copy(affinity_mask, cpu_online_mask); |
| 44 | 45 | *nr_vecs = num_online_cpus(); |
| @@ -56,6 +57,7 @@ struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs) · 11 unmodified lines | ||
| 56 | 57 | } |
| 57 | 58 | *nr_vecs = vecs; |
| 58 | 59 | } |
| 60 | + put_online_cpus(); | |
| 59 | 61 | |
| 60 | 62 | return affinity_mask; |
| 61 | 63 | } |