001-backport_upstream_image_c_fix_non_android_booting.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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. In 1fec3c5 I added a check that if we had an Android image we default to
  7. trying the kernel address for a ramdisk. However when we don't have an
  8. Android image buf is NULL and we oops here. Ensure that we have 'buf'
  9. to check first.
  10. Reported-by: elipe Balbi <balbi@ti.com>
  11. Signed-off-by: Tom Rini <trini@konsulko.com>
  12. ---
  13. common/image.c | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. diff --git a/common/image.c b/common/image.c
  16. index e607109..85c4f39 100644
  17. --- a/common/image.c
  18. +++ b/common/image.c
  19. @@ -913,7 +913,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
  20. * Look for an Android boot image.
  21. */
  22. buf = map_sysmem(images->os.start, 0);
  23. - if (genimg_get_format(buf) == IMAGE_FORMAT_ANDROID)
  24. + if (buf && genimg_get_format(buf) == IMAGE_FORMAT_ANDROID)
  25. select = argv[0];
  26. #endif
  27. --
  28. 1.7.10.4