b8e65b5005d0571c24918f2aa2b62c1ac459969d
[openwrt/openwrt.git] / package / boot / uboot-omap / patches / 001-backport_upstream_image_c_fix_non_android_booting.patch
1 From c139b5ff0999ec3d44a02ebdb623a92e5782e53e Mon Sep 17 00:00:00 2001
2 From: Tom Rini <trini@konsulko.com>
3 Date: Tue, 27 Oct 2015 19:04:40 -0400
4 Subject: [PATCH] image.c: Fix non-Android booting with ramdisk and/or device
5 tree
6
7 In 1fec3c5 I added a check that if we had an Android image we default to
8 trying the kernel address for a ramdisk. However when we don't have an
9 Android image buf is NULL and we oops here. Ensure that we have 'buf'
10 to check first.
11
12 Reported-by: elipe Balbi <balbi@ti.com>
13 Signed-off-by: Tom Rini <trini@konsulko.com>
14 ---
15 common/image.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18 diff --git a/common/image.c b/common/image.c
19 index e607109..85c4f39 100644
20 --- a/common/image.c
21 +++ b/common/image.c
22 @@ -913,7 +913,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
23 * Look for an Android boot image.
24 */
25 buf = map_sysmem(images->os.start, 0);
26 - if (genimg_get_format(buf) == IMAGE_FORMAT_ANDROID)
27 + if (buf && genimg_get_format(buf) == IMAGE_FORMAT_ANDROID)
28 select = argv[0];
29 #endif
30
31 --
32 1.7.10.4
33