VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Kirill Tkhai <ktkhai@virtuozzo.com> 2020-12-31 00:33:18 +0300 committer: Herbert Xu <herbert@gondor.apana.org.au> 2021-01-08 15:37:55 +1100 commit: 3c02e04fd4f57130e4fa75fab6f528f7a52db9b5 parent: 0aa171e9b267ce7c52d3a3df7bc9c1fc0203dec5
Commit Summary:
crypto: xor - Fix divide error in do_xor_speed()
Diffstat:
1 file changed, 2 insertions, 0 deletions
diff --git a/crypto/xor.c b/crypto/xor.c
index eacbf4f93990..8f899f898ec9 100644
--- a/crypto/xor.c
+++ b/crypto/xor.c
@@ -107,6 +107,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2)
 	preempt_enable();
 
 	// bytes/ns == GB/s, multiply by 1000 to get MB/s [not MiB/s]
+	if (!min)
+		min = 1;
 	speed = (1000 * REPS * BENCH_SIZE) / (unsigned int)ktime_to_ns(min);
 	tmpl->speed = speed;