diff options
author | Vladimir Oltean <[email protected]> | 2019-09-29 02:01:39 +0300 |
---|---|---|
committer | David S. Miller <[email protected]> | 2019-09-30 18:32:20 -0700 |
commit | 68ce6688a5baefde30914fc07fc27292dbbe8320 (patch) | |
tree | effbc924ac1ced53a241d80025857565ffa18777 /tools/perf/util/trace-event-scripting.c | |
parent | 68501df92d116b760777a2cfda314789f926476f (diff) |
net: sched: taprio: Fix potential integer overflow in taprio_set_picos_per_byte
The speed divisor is used in a context expecting an s64, but it is
evaluated using 32-bit arithmetic.
To avoid that happening, instead of multiplying by 1,000,000 in the
first place, simplify the fraction and do a standard 32 bit division
instead.
Fixes: f04b514c0ce2 ("taprio: Set default link speed to 10 Mbps in taprio_set_picos_per_byte")
Reported-by: Gustavo A. R. Silva <[email protected]>
Suggested-by: Eric Dumazet <[email protected]>
Signed-off-by: Vladimir Oltean <[email protected]>
Acked-by: Vinicius Costa Gomes <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions