aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2014-11-21 13:24:29 -0500
committerBrian Norris <computersforpeace@gmail.com>2014-12-12 22:28:43 -0500
commit68f29815034e9dc9ed53cad85946c32b07adc8cc (patch)
tree7b1b0cad1e4d53beacff83faafc5f457a1dcb8ac
parent92b633a8a482c4bc1ff3b7cffdcace7836861554 (diff)
mtd: tests: abort torturetest on erase errors
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> Cc: <stable@vger.kernel.org>
-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)
264 int i; 264 int i;
265 void *patt; 265 void *patt;
266 266
267 mtdtest_erase_good_eraseblocks(mtd, bad_ebs, eb, ebcnt); 267 err = mtdtest_erase_good_eraseblocks(mtd, bad_ebs, eb, ebcnt);
268 if (err)
269 goto out;
268 270
269 /* Check if the eraseblocks contain only 0xFF bytes */ 271 /* Check if the eraseblocks contain only 0xFF bytes */
270 if (check) { 272 if (check) {