lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210417102426.GP6048@kadam>
Date:   Sat, 17 Apr 2021 13:24:26 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Miquel Raynal <miquel.raynal@...tlin.com>
Cc:     Richard Weinberger <richard@....at>,
        Vignesh Raghavendra <vigneshr@...com>,
        Boris Brezillon <boris.brezillon@...labora.com>,
        Tudor Ambarus <tudor.ambarus@...rochip.com>,
        Manivannan Sadhasivam <mani@...nel.org>,
        linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] mtd: rawnand: fix an error code in nand_setup_interface()

On Fri, Apr 16, 2021 at 05:00:40PM +0200, Miquel Raynal wrote:
> Hi Dan,
> 
> Dan Carpenter <dan.carpenter@...cle.com> wrote on Wed, 14 Apr 2021
> 08:56:33 +0300:
> 
> > We should return an error code if the timing mode is not acknowledged
> > by the NAND chip.
> 
> This truly is questionable (and I am not yet decided whether the answer
> should be yes or no).
> 
> Returning an error here would produce the entire boot sequence to fail,
> even though the NAND chip would work in mode 0.
> 
> Not returning an error would print the below warning (so the
> user/developer is warned) and continue the boot with the slowest
> timing interface.
> 
> Honestly I would be more in favor of letting things as they are
> because I don't think this may be considered as a buggy situation, but I
> am open to discussion.
> 

If we decided that the original code is correct then one way to silence
the warning would be to do:

	if (tmode_param[0] != chip->best_interface_config->timings.mode) {
		pr_warn("timing mode %d not acknowledged by the NAND chip\n",
 			chip->best_interface_config->timings.mode);
		ret = 0;
		goto err_reset_chip;
	}

Setting "ret = 0;" right before the goto makes the code look more
intentional to human readers as well.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ