aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch
blob: b8e65b5005d0571c24918f2aa2b62c1ac459969d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From c139b5ff0999ec3d44a02ebdb623a92e5782e53e Mon Sep 17 00:00:00 2001
From: Tom Rini <trini@konsulko.com>
Date: Tue, 27 Oct 2015 19:04:40 -0400
Subject: [PATCH] image.c: Fix non-Android booting with ramdisk and/or device
 tree

In 1fec3c5 I added a check that if we had an Android image we default to
trying the kernel address for a ramdisk.  However when we don't have an
Android image buf is NULL and we oops here.  Ensure that we have 'buf'
to check first.

Reported-by: elipe Balbi <balbi@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 common/image.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/image.c b/common/image.c
index e607109..85c4f39 100644
--- a/common/image.c
+++ b/common/image.c
@@ -913,7 +913,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
 	 * Look for an Android boot image.
 	 */
 	buf = map_sysmem(images->os.start, 0);
-	if (genimg_get_format(buf) == IMAGE_FORMAT_ANDROID)
+	if (buf && genimg_get_format(buf) == IMAGE_FORMAT_ANDROID)
 		select = argv[0];
 #endif
 
-- 
1.7.10.4