mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-09 20:18:54 -04:00
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>
This commit is contained in:
parent
43e6627259
commit
81c1d7b605
@ -89,7 +89,7 @@ static int mmc_file_op(enum dfu_mmc_op op, struct dfu_entity *dfu,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dfu->layout != DFU_RAW_ADDR) {
|
if (dfu->layout != DFU_RAW_ADDR && op == DFU_OP_READ) {
|
||||||
str_env = getenv("filesize");
|
str_env = getenv("filesize");
|
||||||
if (str_env == NULL) {
|
if (str_env == NULL) {
|
||||||
puts("dfu: Wrong file size!\n");
|
puts("dfu: Wrong file size!\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user