linux-stable/drivers/mtd/tests
Wolfram Sang 2f4478ccff mtd: tests: stresstest: bail out if device has not enough eraseblocks
stresstest needs at least two eraseblocks. Bail out gracefully if that
condition is not met. Fixes the following 'division by zero' OOPS:

[  619.100000] mtd_stresstest: MTD device size 131072, eraseblock size 131072, page size 2048, count of eraseblocks 1, pages per eraseblock 64, OOB size 64
[  619.120000] mtd_stresstest: scanning for bad eraseblocks
[  619.120000] mtd_stresstest: scanned 1 eraseblocks, 0 are bad
[  619.130000] mtd_stresstest: doing operations
[  619.130000] mtd_stresstest: 0 operations done
[  619.140000] Division by zero in kernel.
...

caused by

        /* Read or write up 2 eraseblocks at a time - hence 'ebcnt - 1' */
        eb %= (ebcnt - 1);

Cc: stable@kernel.org
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09 18:12:42 +00:00
..
Makefile mtd: add nand_ecc test module 2009-11-30 09:41:49 +00:00
mtd_nandecctest.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
mtd_oobtest.c mtd: tests: don't use mtd0 as a default 2011-10-30 14:31:04 +02:00
mtd_pagetest.c mtd: tests: don't use mtd0 as a default 2011-10-30 14:31:04 +02:00
mtd_readtest.c mtd: tests: don't use mtd0 as a default 2011-10-30 14:31:04 +02:00
mtd_speedtest.c mtd: tests: don't use mtd0 as a default 2011-10-30 14:31:04 +02:00
mtd_stresstest.c mtd: tests: stresstest: bail out if device has not enough eraseblocks 2012-01-09 18:12:42 +00:00
mtd_subpagetest.c mtd: tests: don't use mtd0 as a default 2011-10-30 14:31:04 +02:00
mtd_torturetest.c mtd: tests: don't use mtd0 as a default 2011-10-30 14:31:04 +02:00