diff mbox

nanddump: fix initialization of bad blocks oob data buffer

Message ID 0870ac8ab250ec91dceb2cc461fe82c0d7995bc8.1286788714.git.baruch@tkos.co.il
State New, archived
Headers show

Commit Message

Baruch Siach Oct. 11, 2010, 9:19 a.m. UTC
When dumping oob data of a bad block, initialize oobbuf with 0xff, instead of
readbuf.  This avoids bogus oob data on output.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 nanddump.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Mike Frysinger Oct. 11, 2010, 5:07 p.m. UTC | #1
On Mon, Oct 11, 2010 at 05:19, Baruch Siach wrote:
> When dumping oob data of a bad block, initialize oobbuf with 0xff, instead of
> readbuf.  This avoids bogus oob data on output.
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
Artem Bityutskiy Oct. 12, 2010, 10:02 a.m. UTC | #2
On Mon, 2010-10-11 at 11:19 +0200, Baruch Siach wrote:
> When dumping oob data of a bad block, initialize oobbuf with 0xff, instead of
> readbuf.  This avoids bogus oob data on output.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  nanddump.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/nanddump.c b/nanddump.c
> index 3589931..0fdf736 100644
> --- a/nanddump.c
> +++ b/nanddump.c
> @@ -452,7 +452,7 @@ int main(int argc, char * const argv[])
>  			continue;
>  
>  		if (badblock) {
> -			memset (readbuf, 0xff, meminfo.oobsize);
> +			memset (oobbuf, 0xff, meminfo.oobsize);
Removed junk white-space
>  		} else {
>  			/* Read OOB data and exit on failure */
>  			oob.start = ofs;

and push to mtd-utils.git, thanks!
diff mbox

Patch

diff --git a/nanddump.c b/nanddump.c
index 3589931..0fdf736 100644
--- a/nanddump.c
+++ b/nanddump.c
@@ -452,7 +452,7 @@  int main(int argc, char * const argv[])
 			continue;
 
 		if (badblock) {
-			memset (readbuf, 0xff, meminfo.oobsize);
+			memset (oobbuf, 0xff, meminfo.oobsize);
 		} else {
 			/* Read OOB data and exit on failure */
 			oob.start = ofs;