From: Tom Rini Date: Tue, 27 Oct 2015 23:04:40 +0000 (-0400) Subject: image.c: Fix non-Android booting with ramdisk and/or device tree X-Git-Tag: archive/raspbian/2016.11+dfsg1-3+rpi1~1^2~14 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=06e0c53a445cd2a56011b16bec514f51940999e4;p=u-boot.git 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 Signed-off-by: Tom Rini Gbp-Pq: Topic upstream Gbp-Pq: Name image.c-Fix-non-Android-booting-with-ramdisk-and-or-.patch --- diff --git a/common/image.c b/common/image.c index e6071099d..85c4f39cd 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