summaryrefslogtreecommitdiff
path: root/drivers/dfu
diff options
context:
space:
mode:
authorƁukasz Majewski <l.majewski@samsung.com>2012-08-23 23:33:56 +0000
committerMarek Vasut <marex@denx.de>2012-09-21 00:05:00 +0200
commit81c1d7b605e1a48d3c02248c5e51fabcf42f5014 (patch)
tree8db3e0f096f30a5a324a4bdcc57f535717faa5fb /drivers/dfu
parent43e6627259da3900a73f40fb2fe3a6f106c0e2d7 (diff)
downloadu-boot-imx-81c1d7b605e1a48d3c02248c5e51fabcf42f5014.zip
u-boot-imx-81c1d7b605e1a48d3c02248c5e51fabcf42f5014.tar.gz
u-boot-imx-81c1d7b605e1a48d3c02248c5e51fabcf42f5014.tar.bz2
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 <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/dfu')
-rw-r--r--drivers/dfu/dfu_mmc.c2
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");