From: Rob Herring <robh@kernel.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] image: fix support for Android boot images with no ramdisk
Date: Mon, 5 Oct 2015 14:37:07 -0500 [thread overview]
Message-ID: <1444073827-822-1-git-send-email-robh@kernel.org> (raw)
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 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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));
--
2.1.4
next reply other threads:[~2015-10-05 19:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-05 19:37 Rob Herring [this message]
2015-10-12 15:16 ` [U-Boot] image: fix support for Android boot images with no ramdisk Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444073827-822-1-git-send-email-robh@kernel.org \
--to=robh@kernel.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox