From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 24 Aug 2012 16:31:47 +0200 Subject: [U-Boot] [PATCH 2/2] dfu:usb:fix: Read the "filesize" environment variable only when file read In-Reply-To: <1345800836-15573-2-git-send-email-l.majewski@samsung.com> References: <1345800836-15573-1-git-send-email-l.majewski@samsung.com> <1345800836-15573-2-git-send-email-l.majewski@samsung.com> Message-ID: <201208241631.47839.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Lukasz Majewski, > The "filesize" environment variable shall be read only when relevant > file is read. > > Signed-off-by: Lukasz Majewski > Signed-off-by: Kyungmin Park Reviewed-by: Marek Vasut > --- > drivers/dfu/dfu_mmc.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c > index 2270a61..5d504df 100644 > --- a/drivers/dfu/dfu_mmc.c > +++ b/drivers/dfu/dfu_mmc.c > @@ -89,7 +89,7 @@ static int mmc_file_op(enum dfu_mmc_op op, struct > dfu_entity *dfu, return ret; > } > > - if (dfu->layout != DFU_RAW_ADDR) { > + if (dfu->layout != DFU_RAW_ADDR && op == DFU_OP_READ) { > str_env = getenv("filesize"); > if (str_env == NULL) { > puts("dfu: Wrong file size!\n"); Best regards, Marek Vasut