]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_bootm.c
New implementation for internal handling of environment variables.
[u-boot] / common / cmd_bootm.c
index adfa6cd18aea82bca910165c79295d73f6a3d0d8..4c6ed4870374deb822f6a36c1144b42a92e83975 100644 (file)
@@ -333,6 +333,9 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
        ulong image_start = os.image_start;
        ulong image_len = os.image_len;
        uint unc_len = CONFIG_SYS_BOOTM_LEN;
+#if defined(CONFIG_LZMA) || defined(CONFIG_LZO)
+       int ret;
+#endif /* defined(CONFIG_LZMA) || defined(CONFIG_LZO) */
 
        const char *type_name = genimg_get_type_name (os.type);
 
@@ -386,12 +389,14 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
                break;
 #endif /* CONFIG_BZIP2 */
 #ifdef CONFIG_LZMA
-       case IH_COMP_LZMA:
+       case IH_COMP_LZMA: {
+               SizeT lzma_len = unc_len;
                printf ("   Uncompressing %s ... ", type_name);
 
-               int ret = lzmaBuffToBuffDecompress(
-                       (unsigned char *)load, &unc_len,
+               ret = lzmaBuffToBuffDecompress(
+                       (unsigned char *)load, &lzma_len,
                        (unsigned char *)image_start, image_len);
+               unc_len = lzma_len;
                if (ret != SZ_OK) {
                        printf ("LZMA: uncompress or overwrite error %d "
                                "- must RESET board to recover\n", ret);
@@ -400,12 +405,13 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
                }
                *load_end = load + unc_len;
                break;
+       }
 #endif /* CONFIG_LZMA */
 #ifdef CONFIG_LZO
        case IH_COMP_LZO:
                printf ("   Uncompressing %s ... ", type_name);
 
-               int ret = lzop_decompress((const unsigned char *)image_start,
+               ret = lzop_decompress((const unsigned char *)image_start,
                                          image_len, (unsigned char *)load,
                                          &unc_len);
                if (ret != LZO_E_OK) {