diff options
author | Heinrich Schuchardt <[email protected]> | 2015-04-16 12:47:47 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2015-04-17 09:04:07 -0400 |
commit | ac1b398de1ef94aeee8ba87b0120763526572a6e (patch) | |
tree | 61e32dcc897d25328065dec06ccc3ab944316e9d /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | ff691f6e03815dc8f99461ea509df863a879fc3a (diff) |
kernel/fork.c: avoid division by zero
PAGE_SIZE is not guaranteed to be equal to or less than 8 times the
THREAD_SIZE.
E.g. architecture hexagon may have page size 1M and thread size 4096.
This would lead to a division by zero in the calculation of max_threads.
With 32-bit calculation there is no solution which delivers valid results
for all possible combinations of the parameters. The code is only called
once. Hence a 64-bit calculation can be used as solution.
[[email protected]: use clamp_t(), per Oleg]
Signed-off-by: Heinrich Schuchardt <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Guenter Roeck <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions