diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2011-11-29 15:34:08 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-25 17:24:32 -0800 |
commit | f3a6e79c583423a55f7068ccdad732a5f4a0faad (patch) | |
tree | 6dc88858c4477bfb4755bc64b39638a6dd61acf1 /drivers/rtc | |
parent | 488e572df737befdfc783503642d70ea18b3a001 (diff) | |
download | kernel_samsung_crespo-f3a6e79c583423a55f7068ccdad732a5f4a0faad.zip kernel_samsung_crespo-f3a6e79c583423a55f7068ccdad732a5f4a0faad.tar.gz kernel_samsung_crespo-f3a6e79c583423a55f7068ccdad732a5f4a0faad.tar.bz2 |
mtd: tests: stresstest: bail out if device has not enough eraseblocks
commit 2f4478ccff7df845dc9c0f8996a96373122c4417 upstream.
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);
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/rtc')
0 files changed, 0 insertions, 0 deletions