diff options
author | Wen Yang <wenyang@linux.alibaba.com> | 2020-01-10 21:15:26 +0800 |
---|---|---|
committer | Julia Lawall <Julia.Lawall@inria.fr> | 2021-09-11 22:57:39 +0200 |
commit | ac5f313624d876b41d4a1292181d17e80d44159c (patch) | |
tree | 99f687704aee1687427dcfd906c5076678c7d14d /README | |
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 <wenyang@linux.alibaba.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Cc: Gilles Muller <Gilles.Muller@lip6.fr>
Cc: Nicolas Palix <nicolas.palix@imag.fr>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Matthias Maennich <maennich@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: cocci@systeme.lip6.fr
Cc: linux-kernel@vger.kernel.org
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions