All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] nand: Fix access to last block in NAND devices
@ 2009-12-09  8:01 Stefan Roese
  2009-12-11 19:12 ` Scott Wood
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Roese @ 2009-12-09  8:01 UTC (permalink / raw)
  To: u-boot

Currently, the last block of NAND devices can't be accessed. This patch
fixes this issue by correcting the boundary checking (off-by-one error).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Wolfgang Denk <wd@denx.de>
---
 drivers/mtd/nand/nand_util.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index 7085d42..61bf7e6 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -490,7 +490,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
 
 	len_incl_bad = get_len_incl_bad (nand, offset, *length);
 
-	if ((offset + len_incl_bad) >= nand->size) {
+	if ((offset + len_incl_bad) > nand->size) {
 		printf ("Attempt to write outside the flash area\n");
 		return -EINVAL;
 	}
@@ -562,7 +562,7 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
 
 	len_incl_bad = get_len_incl_bad (nand, offset, *length);
 
-	if ((offset + len_incl_bad) >= nand->size) {
+	if ((offset + len_incl_bad) > nand->size) {
 		printf ("Attempt to read outside the flash area\n");
 		return -EINVAL;
 	}
-- 
1.6.6.rc1

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

* [U-Boot] [PATCH] nand: Fix access to last block in NAND devices
  2009-12-09  8:01 [U-Boot] [PATCH] nand: Fix access to last block in NAND devices Stefan Roese
@ 2009-12-11 19:12 ` Scott Wood
  0 siblings, 0 replies; 2+ messages in thread
From: Scott Wood @ 2009-12-11 19:12 UTC (permalink / raw)
  To: u-boot

On Wed, Dec 09, 2009 at 09:01:43AM +0100, Stefan Roese wrote:
> Currently, the last block of NAND devices can't be accessed. This patch
> fixes this issue by correcting the boundary checking (off-by-one error).
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Scott Wood <scottwood@freescale.com>
> Cc: Wolfgang Denk <wd@denx.de>
> ---
>  drivers/mtd/nand/nand_util.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Applied to u-boot-nand-flash.

-Scott

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

end of thread, other threads:[~2009-12-11 19:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-09  8:01 [U-Boot] [PATCH] nand: Fix access to last block in NAND devices Stefan Roese
2009-12-11 19:12 ` Scott Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.