Re: [GIT PULL] scheduler fix

From: Andreas Schwab
Date: Thu Apr 08 2010 - 12:04:27 EST


Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> On Thu, 8 Apr 2010, Ingo Molnar wrote:
>>
>> - if (len < nr_cpu_ids)
>> + if ((len * BITS_PER_BYTE) < nr_cpu_ids)
>> return -EINVAL;
>
> Not that it really matters, but this will now fail for no good reason if
> you pass it a half-gigabyte area due to overflow.

Which can easily be avoided.

if (len < DIV_ROUND_UP(nr_cpu_ids, BITS_PER_BYTE))

Andreas.

--
Andreas Schwab, schwab@xxxxxxxxxx
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/