[PATCH] nanddump: fix initialization of bad blocks oob data buffer

Artem Bityutskiy dedekind1 at gmail.com
Tue Oct 12 06:02:22 EDT 2010


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 at 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!

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list