On Thu, Apr 2, 2015 at 11:13 AM, Richard Weinberger <rich...@nod.at> wrote:

> +               ret = mtdtest_erase_eraseblock(mtd, i);
> +               if (ret) {
> +                       err = ret;
> +                       goto out;
> +               }

Why not just do like this instead?

              err = mtdtest_erase_eraseblock(mtd, i);
              if (err)
                 goto out;

> +
> +               ret = mtdtest_write(mtd, i * mtd->erasesize, mtd->erasesize,
> +                                   iobuf_orig);
> +               if (ret) {
> +                       err = ret;
> +                       goto out;
> +               }

Same here.

> +               ret = mtdtest_relax();
> +               if (ret)
> +                       goto out;

Here you propagate the wrong error. You test for 'ret' and propagate 'err'.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to