summaryrefslogtreecommitdiff
path: root/common/image-android.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2015-10-05 14:37:07 -0500
committerTom Rini <trini@konsulko.com>2015-10-11 17:12:10 -0400
commit9950098e31004fdfb94c8c6ce3f4b27566a532bd (patch)
tree2f19cd559baf1b738330ff50b609010eb5e37c4b /common/image-android.c
parent027b728d4aafb5cf97abc804944a77b837b0f07f (diff)
downloadu-boot-imx-9950098e31004fdfb94c8c6ce3f4b27566a532bd.zip
u-boot-imx-9950098e31004fdfb94c8c6ce3f4b27566a532bd.tar.gz
u-boot-imx-9950098e31004fdfb94c8c6ce3f4b27566a532bd.tar.bz2
image: fix support for Android boot images with no ramdisk
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>
Diffstat (limited to 'common/image-android.c')
-rw-r--r--common/image-android.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/image-android.c b/common/image-android.c
index d946c2f..b6a94b3 100644
--- a/common/image-android.c
+++ b/common/image-android.c
@@ -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));