[U-Boot] mtd: nand: use ssize_t instead of size_t to prevent infinite loop

Scott Wood scottwood at freescale.com
Wed May 22 23:51:29 CEST 2013


On Fri, Mar 01, 2013 at 11:00:34PM -0000, htbegin wrote:
> When a all 0xFF buffer is passed to drop_ffs, the no-0xFF check loop
> will loop forever.
> After the fix, If ssize_t i = -1 and size_t l = i + 1, the value of l
> will still be 0 as expected.
> 
> Signed-off-by: Tao Hou <hotforest at gmail.com>
> Cc: Ben Gardiner <bengardiner at nanometrics.ca>
> Cc: Scott Wood <scottwood at freescale.com>
> 
> ---
> drivers/mtd/nand/nand_util.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to u-boot-nand-flash

-Scott



More information about the U-Boot mailing list