mtd: readtest: don't clobber error reports
authorBrian Norris <computersforpeace@gmail.com>
Mon, 4 May 2015 18:43:31 +0000 (11:43 -0700)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 14 May 2015 16:56:31 +0000 (09:56 -0700)
Commit 2a6a28e7922c ("mtd: Make MTD tests cancelable") accidentally
clobbered any read failure reports.

Coverity CID #1296020

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/tests/readtest.c

index a3196b750a220663b22f866fbf8173ca6fe81d4a..58df07acdbdb5f4c397511834265c233c3a7f62d 100644 (file)
@@ -191,9 +191,11 @@ static int __init mtd_readtest_init(void)
                                err = ret;
                }
 
-               err = mtdtest_relax();
-               if (err)
+               ret = mtdtest_relax();
+               if (ret) {
+                       err = ret;
                        goto out;
+               }
        }
 
        if (err)