]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
torture: Avoid modulo-zero error in torture_hrtimeout_ns()
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 4 Mar 2026 23:40:39 +0000 (15:40 -0800)
committerJoel Fernandes <joelagnelf@nvidia.com>
Mon, 30 Mar 2026 19:48:14 +0000 (15:48 -0400)
commita18396219ba52b524d8b86bf9e2515b01c068614
treed4964678a62554b90afb359bacd8df04e503d158
parent2243517a5440caa635b945deb7915397ef39b29b
torture: Avoid modulo-zero error in torture_hrtimeout_ns()

Currently, all calls to torture_hrtimeout_ns() either provide a non-zero
fuzzt_ns or a NULL trsp, either of which avoids taking the modulus of a
zero-valued fuzzt_ns.  But this code should do a better job of defending
itself, so this commit explicitly checks fuzzt_ns and avoids the modulus
when its value is zero.

Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
kernel/torture.c