Skip to contentSkip to conversation

image: fix support for Android boot images with no ramdisk

PATCH In review Rob Herring 2 participants 2 messages Oct 5, 2015 – Oct 12, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 common/image-android.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
common/image-android.c +3 -1
index d946c2f..b6a94b3 100644
@@ -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));
Signature · 1 line
2.1.4
#1 lore raw
Quoted 5 lines · Rob Herring

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151012/8791be72/attachment.sig>