mtd: tests: fix integer overflow issues
authorBrian Norris <computersforpeace@gmail.com>
Tue, 22 Jul 2014 02:07:12 +0000 (19:07 -0700)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 19 Aug 2014 18:53:08 +0000 (11:53 -0700)
commit1001ff7a4f64f3f4264e69d3ed70ff428f627e01
tree9b673e00fda7873a9958cf5d60f66a49cf2e020c
parent8c3f3f1d7941bcb25590b784f84accd7dcb44ba3
mtd: tests: fix integer overflow issues

These multiplications are done with 32-bit arithmetic, then converted to
64-bit. We should widen the integers first to prevent overflow. This
could be a problem for large (>4GB) MTD's.

Detected by Coverity.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
drivers/mtd/tests/mtd_test.c
drivers/mtd/tests/nandbiterrs.c
drivers/mtd/tests/oobtest.c
drivers/mtd/tests/pagetest.c
drivers/mtd/tests/readtest.c
drivers/mtd/tests/speedtest.c
drivers/mtd/tests/subpagetest.c