summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/tests/speedtest.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2015-02-28 11:02:26 +0100
committerBrian Norris <computersforpeace@gmail.com>2015-03-11 23:21:47 +0100
commitb9da8bae416efda5ad61c7c92edbb30de15ff7ee (patch)
tree85278d8d43ad2db78971ed9de0cc08f5097c7014 /drivers/mtd/tests/speedtest.c
parentmtd: onenand: drop dead code (diff)
downloadlinux-b9da8bae416efda5ad61c7c92edbb30de15ff7ee.tar.xz
linux-b9da8bae416efda5ad61c7c92edbb30de15ff7ee.zip
mtd: tests: fix more potential integer overflows
Caught by Coverity (CID #200625 and others) Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Akinobu Mita <akinobu.mita@gmail.com>
Diffstat (limited to 'drivers/mtd/tests/speedtest.c')
-rw-r--r--drivers/mtd/tests/speedtest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/tests/speedtest.c b/drivers/mtd/tests/speedtest.c
index 5ee9f7021020..a77019cb5510 100644
--- a/drivers/mtd/tests/speedtest.c
+++ b/drivers/mtd/tests/speedtest.c
@@ -185,7 +185,7 @@ static long calc_speed(void)
(finish.tv_usec - start.tv_usec) / 1000;
if (ms == 0)
return 0;
- k = goodebcnt * (mtd->erasesize / 1024) * 1000;
+ k = (uint64_t)goodebcnt * (mtd->erasesize / 1024) * 1000;
do_div(k, ms);
return k;
}