Messages in this thread | | | From | Andreas Schwab <> | Subject | Re: [GIT PULL] scheduler fix | Date | Thu, 08 Apr 2010 18:03:52 +0200 |
| |
Linus Torvalds <torvalds@linux-foundation.org> 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@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."
| |