From a1744ab6a06a19b143cc9bbfe703b31a5e869c17 Mon Sep 17 00:00:00 2001 From: Philippe Reynes Date: Fri, 28 Jun 2019 16:07:15 +0200 Subject: [PATCH] uboot_env: nand: fix return of devread When the function devread read the environement from a nand, the value returned is always 0. But, the check on the value returned is done on the environment size, so we return the size of data read. Signed-off-by: Philippe Reynes Acked-by: Stefano Babic --- src/uboot_env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uboot_env.c b/src/uboot_env.c index ec42905..6e2ca57 100644 --- a/src/uboot_env.c +++ b/src/uboot_env.c @@ -274,8 +274,8 @@ static int devread(struct uboot_ctx *ctx, unsigned int copy, void *data) start += dev->sectorsize; data += blocksize; count -= blocksize; + ret += blocksize; } - ret = count; break; }