Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753395AbbDBPC3 (ORCPT ); Thu, 2 Apr 2015 11:02:29 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:36650 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752295AbbDBPC0 (ORCPT ); Thu, 2 Apr 2015 11:02:26 -0400 MIME-Version: 1.0 In-Reply-To: <1427984026-31100-1-git-send-email-richard@nod.at> References: <1427984026-31100-1-git-send-email-richard@nod.at> Date: Thu, 2 Apr 2015 12:02:24 -0300 Message-ID: Subject: Re: [PATCH] mtd: Add simple read disturb test From: Fabio Estevam To: Richard Weinberger Cc: Brian Norris , "linux-mtd@lists.infradead.org" , David Woodhouse , linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1094 Lines: 34 On Thu, Apr 2, 2015 at 11:13 AM, Richard Weinberger 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/