* [U-Boot] [PATCH] mtd: nand: omap_gpmc: fix error handling
@ 2015-01-02 17:49 Guido Martínez
2015-01-03 6:02 ` Stefan Roese
2015-01-07 15:15 ` [U-Boot] " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Guido Martínez @ 2015-01-02 17:49 UTC (permalink / raw)
To: u-boot
"err" was an unsigned variable, causing negative error codes to turn
into positive values, which are interpreted as an amount of succesfully
corrected bitflips (and thus not an error).
In particular, this resulted in that if the elm reports uncorrectable
errors (-EBADMSG), the MTD layer (and UBI) falsely succeeded.
Signed-off-by: Guido Mart?nez <guido@vanguardiasur.com.ar>
---
drivers/mtd/nand/omap_gpmc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index 93829a4..459904d 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -368,8 +368,9 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat,
uint32_t error_loc[ELM_MAX_ERROR_COUNT];
enum bch_level bch_type;
uint32_t i, ecc_flag = 0;
- uint8_t count, err = 0;
+ uint8_t count;
uint32_t byte_pos, bit_pos;
+ int err = 0;
/* check calculated ecc */
for (i = 0; i < ecc->bytes && !ecc_flag; i++) {
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] mtd: nand: omap_gpmc: fix error handling
2015-01-02 17:49 [U-Boot] [PATCH] mtd: nand: omap_gpmc: fix error handling Guido Martínez
@ 2015-01-03 6:02 ` Stefan Roese
2015-01-07 15:15 ` [U-Boot] " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2015-01-03 6:02 UTC (permalink / raw)
To: u-boot
On 02.01.2015 18:49, Guido Mart?nez wrote:
> "err" was an unsigned variable, causing negative error codes to turn
> into positive values, which are interpreted as an amount of succesfully
> corrected bitflips (and thus not an error).
>
> In particular, this resulted in that if the elm reports uncorrectable
> errors (-EBADMSG), the MTD layer (and UBI) falsely succeeded.
>
> Signed-off-by: Guido Mart?nez <guido@vanguardiasur.com.ar>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] mtd: nand: omap_gpmc: fix error handling
2015-01-02 17:49 [U-Boot] [PATCH] mtd: nand: omap_gpmc: fix error handling Guido Martínez
2015-01-03 6:02 ` Stefan Roese
@ 2015-01-07 15:15 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2015-01-07 15:15 UTC (permalink / raw)
To: u-boot
On Fri, Jan 02, 2015 at 02:49:10PM -0300, Guido Mart?nez wrote:
> "err" was an unsigned variable, causing negative error codes to turn
> into positive values, which are interpreted as an amount of succesfully
> corrected bitflips (and thus not an error).
>
> In particular, this resulted in that if the elm reports uncorrectable
> errors (-EBADMSG), the MTD layer (and UBI) falsely succeeded.
>
> Signed-off-by: Guido Mart?nez <guido@vanguardiasur.com.ar>
> Reviewed-by: Stefan Roese <sr@denx.de>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150107/35cc64b8/attachment.pgp>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-07 15:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-02 17:49 [U-Boot] [PATCH] mtd: nand: omap_gpmc: fix error handling Guido Martínez
2015-01-03 6:02 ` Stefan Roese
2015-01-07 15:15 ` [U-Boot] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox