linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] UBI: fastmap: correct error check
@ 2014-05-21  5:35 Brian Norris
  2014-05-21  7:29 ` Richard Weinberger
  0 siblings, 1 reply; 6+ messages in thread
From: Brian Norris @ 2014-05-21  5:35 UTC (permalink / raw)
  To: linux-mtd; +Cc: Richard Weinberger, Brian Norris, Artem Bityutskiy

The return value from ubi_io_read_ec_hdr() was stored in 'err', not in
'ret'.

This issue was reported by Coverity Scan.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/fastmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index c5dad652614d..6de0e10fcea3 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -423,7 +423,7 @@ static int scan_pool(struct ubi_device *ubi, struct ubi_attach_info *ai,
 				pnum, err);
 			ret = err > 0 ? UBI_BAD_FASTMAP : err;
 			goto out;
-		} else if (ret == UBI_IO_BITFLIPS)
+		} else if (err == UBI_IO_BITFLIPS)
 			scrub = 1;
 
 		/*
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-16  5:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21  5:35 [PATCH] UBI: fastmap: correct error check Brian Norris
2014-05-21  7:29 ` Richard Weinberger
2014-06-09 17:01   ` Brian Norris
2014-06-10  6:56     ` Artem Bityutskiy
2014-07-09  1:58       ` Brian Norris
2014-07-16  5:34         ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).