diff options
author | Brian Norris <computersforpeace@gmail.com> | 2015-02-28 13:02:26 +0300 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-03-12 01:21:47 +0300 |
commit | b9da8bae416efda5ad61c7c92edbb30de15ff7ee (patch) | |
tree | 85278d8d43ad2db78971ed9de0cc08f5097c7014 /drivers/mtd/tests/stresstest.c | |
parent | 7f2a7ce17dcd381e366a65b6643239338a987715 (diff) | |
download | linux-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/stresstest.c')
-rw-r--r-- | drivers/mtd/tests/stresstest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/tests/stresstest.c b/drivers/mtd/tests/stresstest.c index c9d42cc2df1b..d90c1c01dac6 100644 --- a/drivers/mtd/tests/stresstest.c +++ b/drivers/mtd/tests/stresstest.c @@ -96,7 +96,7 @@ static int do_read(void) if (offs + len > mtd->erasesize) len = mtd->erasesize - offs; } - addr = eb * mtd->erasesize + offs; + addr = (loff_t)eb * mtd->erasesize + offs; return mtdtest_read(mtd, addr, len, readbuf); } @@ -124,7 +124,7 @@ static int do_write(void) offsets[eb + 1] = 0; } } - addr = eb * mtd->erasesize + offs; + addr = (loff_t)eb * mtd->erasesize + offs; err = mtdtest_write(mtd, addr, len, writebuf); if (unlikely(err)) return err; |