diff options
author | Wen Yang <[email protected]> | 2020-01-10 21:15:26 +0800 |
---|---|---|
committer | Julia Lawall <[email protected]> | 2021-09-11 22:57:39 +0200 |
commit | ac5f313624d876b41d4a1292181d17e80d44159c (patch) | |
tree | 99f687704aee1687427dcfd906c5076678c7d14d /tools/perf/util/trace-event-scripting.c | |
parent | c605c39677b9842b0566013e0cf30bc13e90bdbc (diff) |
coccinelle: semantic patch to check for inappropriate do_div() calls
do_div() does a 64-by-32 division.
When the divisor is unsigned long, u64, or s64,
do_div() truncates it to 32 bits, this means it
can test non-zero and be truncated to zero for division.
This semantic patch is inspired by Mateusz Guzik's patch:
commit b0ab99e7736a ("sched: Fix possible divide by zero in avg_atom() calculation")
Signed-off-by: Wen Yang <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
Cc: Gilles Muller <[email protected]>
Cc: Nicolas Palix <[email protected]>
Cc: Michal Marek <[email protected]>
Cc: Matthias Maennich <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions