mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
add check to cpumask_of()
Just like any other function's CPU inputs, the one here shouldn't go unchecked. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
1 parent
c64bf2d2a6
commit
e8bf5addc9
1 file changed
+3
-1
@@ -304,7 +304,9 @@ extern const unsigned long
|
||||
|
||||
static inline const cpumask_t *cpumask_of(unsigned int cpu)
|
||||
{
|
||||
const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG];
|
||||
const unsigned long *p = cpu_bit_bitmap[1 + cpumask_check(cpu) %
|
||||
BITS_PER_LONG];
|
||||
|
||||
return (const cpumask_t *)(p - cpu / BITS_PER_LONG);
|
||||
}
|
||||
|
||||
|
||||