diff options
| author | Wen Yang <[email protected]> | 2020-01-10 13:15:26 +0000 |
|---|---|---|
| committer | Julia Lawall <[email protected]> | 2021-09-11 20:57:39 +0000 |
| commit | ac5f313624d876b41d4a1292181d17e80d44159c (patch) | |
| tree | 99f687704aee1687427dcfd906c5076678c7d14d /drivers/fpga/fpga-region.c | |
| parent | Merge tag 'io_uring-5.15-2021-09-11' of git://git.kernel.dk/linux-block (diff) | |
| download | kernel-ac5f313624d876b41d4a1292181d17e80d44159c.tar.gz kernel-ac5f313624d876b41d4a1292181d17e80d44159c.zip | |
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 'drivers/fpga/fpga-region.c')
0 files changed, 0 insertions, 0 deletions
