Skip to content

Commit

Permalink
mtd: tests: abort torturetest on erase errors
Browse files Browse the repository at this point in the history
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: 6cf7835 ("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>
  • Loading branch information
Brian Norris committed Dec 13, 2014
1 parent 92b633a commit 68f2981
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/mtd/tests/torturetest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 68f2981

Please sign in to comment.