summaryrefslogtreecommitdiff
path: root/drivers/mtd/tests/speedtest.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2015-02-28 13:02:26 +0300
committerBrian Norris <computersforpeace@gmail.com>2015-03-12 01:21:47 +0300
commitb9da8bae416efda5ad61c7c92edbb30de15ff7ee (patch)
tree85278d8d43ad2db78971ed9de0cc08f5097c7014 /drivers/mtd/tests/speedtest.c
parent7f2a7ce17dcd381e366a65b6643239338a987715 (diff)
downloadlinux-b9da8bae416efda5ad61c7c92edbb30de15ff7ee.tar.xz
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;
}