diff options
author | Brian Norris <computersforpeace@gmail.com> | 2015-02-28 11:02:26 +0100 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-03-11 23:21:47 +0100 |
commit | b9da8bae416efda5ad61c7c92edbb30de15ff7ee (patch) | |
tree | 85278d8d43ad2db78971ed9de0cc08f5097c7014 /drivers/mtd/tests/speedtest.c | |
parent | mtd: onenand: drop dead code (diff) | |
download | linux-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.c | 2 |
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; } |