summaryrefslogtreecommitdiff
path: root/drivers/dfu/dfu.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-08-10 07:21:02 -0400
committerTom Rini <trini@konsulko.com>2018-08-10 07:21:02 -0400
commitcdec3ea7e4b80856718a019251d4df7d0db142d0 (patch)
treefd449a86607279863a0a94df5c6df9149beacea5 /drivers/dfu/dfu.c
parentf05ebbf47a9dc863ff4bb084649ecb34d728b5f2 (diff)
parent28a5c88043c80a38040abde957fbe1755b796912 (diff)
Merge branch 'master' of git://git.denx.de/u-boot-usb
Diffstat (limited to 'drivers/dfu/dfu.c')
-rw-r--r--drivers/dfu/dfu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index e7c91193b9..318949529b 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -56,7 +56,7 @@ int dfu_init_env_entities(char *interface, char *devstr)
{
const char *str_env;
char *env_bkp;
- int ret;
+ int ret = 0;
#ifdef CONFIG_SET_DFU_ALT_INFO
set_dfu_alt_info(interface, devstr);
@@ -71,11 +71,13 @@ int dfu_init_env_entities(char *interface, char *devstr)
ret = dfu_config_entities(env_bkp, interface, devstr);
if (ret) {
pr_err("DFU entities configuration failed!\n");
- return ret;
+ pr_err("(partition table does not match dfu_alt_info?)\n");
+ goto done;
}
+done:
free(env_bkp);
- return 0;
+ return ret;
}
static unsigned char *dfu_buf;
@@ -462,7 +464,7 @@ int dfu_config_entities(char *env, char *interface, char *devstr)
ret = dfu_fill_entity(&dfu[i], s, alt_num_cnt, interface,
devstr);
if (ret) {
- free(dfu);
+ /* We will free "dfu" in dfu_free_entities() */
return -1;
}