summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2014-11-21 10:24:29 -0800
committerLuis Henriques <luis.henriques@canonical.com>2015-01-15 10:44:05 +0000
commit53f4c9372025795a26cabacff5651425141f4306 (patch)
treec8102442648f357a7b4b39b917e74b6bf1a0d401 /drivers/mtd
parentf8546f791f2439517095a4faf10a570e961b4a41 (diff)
downloadlinux-stable-53f4c9372025795a26cabacff5651425141f4306.tar.gz
linux-stable-53f4c9372025795a26cabacff5651425141f4306.tar.bz2
linux-stable-53f4c9372025795a26cabacff5651425141f4306.zip
mtd: tests: abort torturetest on erase errors
commit 68f29815034e9dc9ed53cad85946c32b07adc8cc upstream. The torture test should quit once it actually induces an error in the flash. This step was accidentally removed during refactoring. Without this fix, the torturetest just continues infinitely, or until the maximum cycle count is reached. e.g.: ... [ 7619.218171] mtd_test: error -5 while erasing EB 100 [ 7619.297981] mtd_test: error -5 while erasing EB 100 [ 7619.377953] mtd_test: error -5 while erasing EB 100 [ 7619.457998] mtd_test: error -5 while erasing EB 100 [ 7619.537990] mtd_test: error -5 while erasing EB 100 ... Fixes: 6cf78358c94f ("mtd: mtd_torturetest: use mtd_test helpers") Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/tests/torturetest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/tests/torturetest.c b/drivers/mtd/tests/torturetest.c
index eeab96973cf0..b55bc52a1340 100644
--- a/drivers/mtd/tests/torturetest.c
+++ b/drivers/mtd/tests/torturetest.c
@@ -264,7 +264,9 @@ static int __init tort_init(void)
int i;
void *patt;
- mtdtest_erase_good_eraseblocks(mtd, bad_ebs, eb, ebcnt);
+ err = mtdtest_erase_good_eraseblocks(mtd, bad_ebs, eb, ebcnt);
+ if (err)
+ goto out;
/* Check if the eraseblocks contain only 0xFF bytes */
if (check) {