Re: [PATCH] mtd: nand: Add error log for marvell_nfc_end_cmd()

From: Miquel Raynal
Date: Mon Apr 07 2025 - 03:12:12 EST


Hello Liang,

On 07/04/2025 at 10:09:16 +08, Wentao Liang <vulab@xxxxxxxxxxx> wrote:

> The function marvell_nfc_hw_ecc_bch_read_chunk() calls the function
> marvell_nfc_end_cmd(), but dose not check its return value. Since it
> is incorrect to bail from the loop if the marvell_nfc_end_cmd() fails,
> an error log is necessary to prevent silent failure.

The failure will not be silent, *_read_chunk() is called in
marvell_nfc_hw_ecc_bch_read_page() only, where the validity of the data
will be checked. If you really want to make it visible *there* I believe
the correct approach is to change the caller prototype and forward the
error instead.

Thanks,
Miquèl