From: Ɓukasz Majewski Date: Thu, 23 Aug 2012 23:33:56 +0000 (+0000) Subject: dfu:usb:fix: Read the "filesize" environment variable only when file read X-Git-Tag: v2012.10-rc1~3^2~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=81c1d7b605e1a48d3c02248c5e51fabcf42f5014;p=oweals%2Fu-boot.git dfu:usb:fix: Read the "filesize" environment variable only when file read 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 --- diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c index 2270a61eae..5d504dffd1 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");