diff options
Diffstat (limited to 'sys/boot/uboot/lib')
-rw-r--r-- | sys/boot/uboot/lib/copy.c | 7 | ||||
-rw-r--r-- | sys/boot/uboot/lib/glue.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/sys/boot/uboot/lib/copy.c b/sys/boot/uboot/lib/copy.c index bb658e3..51416ac 100644 --- a/sys/boot/uboot/lib/copy.c +++ b/sys/boot/uboot/lib/copy.c @@ -118,6 +118,13 @@ uboot_loadaddr(u_int type, void *data, uint64_t addr) this_block = eubldr; this_size = eblock - eubldr; } + } else if (subldr < sblock && eubldr < eblock) { + /* Loader is below or engulfs the sblock */ + this_block = (eubldr < sblock) ? sblock : eubldr; + this_size = eblock - this_block; + } else { + this_block = 0; + this_size = 0; } if (biggest_size < this_size) { biggest_block = this_block; diff --git a/sys/boot/uboot/lib/glue.c b/sys/boot/uboot/lib/glue.c index d01e33b..32c4df2 100644 --- a/sys/boot/uboot/lib/glue.c +++ b/sys/boot/uboot/lib/glue.c @@ -513,7 +513,7 @@ ub_env_enum(const char *last) if (!syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env)) return (NULL); - if (env == NULL) + if (env == NULL || last == env) /* no more env. variables to enumerate */ return (NULL); |