]> git.sur5r.net Git - u-boot/commitdiff
image: fix support for Android boot images with no ramdisk
authorRob Herring <robh@kernel.org>
Mon, 5 Oct 2015 19:37:07 +0000 (14:37 -0500)
committerTom Rini <trini@konsulko.com>
Sun, 11 Oct 2015 21:12:10 +0000 (17:12 -0400)
If an Android boot image does not contain a ramdisk, make sure rd_len
and rd_data are returned to indicate no ramdisk rather than just relying
on returning an error.

Signed-off-by: Rob Herring <robh@kernel.org>
common/image-android.c

index d946c2f814c17396dcc4c123a627d309cdb8c806..b6a94b3a30b89ce00e582da1ba81e869d5b4b0d5 100644 (file)
@@ -130,8 +130,10 @@ ulong android_image_get_kload(const struct andr_img_hdr *hdr)
 int android_image_get_ramdisk(const struct andr_img_hdr *hdr,
                              ulong *rd_data, ulong *rd_len)
 {
-       if (!hdr->ramdisk_size)
+       if (!hdr->ramdisk_size) {
+               *rd_data = *rd_len = 0;
                return -1;
+       }
 
        printf("RAM disk load addr 0x%08x size %u KiB\n",
               hdr->ramdisk_addr, DIV_ROUND_UP(hdr->ramdisk_size, 1024));