Author: blueswirl Date: Sun Aug 8 20:28:48 2010 New Revision: 841 URL: http://tracker.coreboot.org/trac/openbios/changeset/841
Log: linux_load: fix open_io return value checks
open_io() returns -1 on error and 0 is a valid return value.
Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/arch/sparc32/linux_load.c trunk/openbios-devel/arch/sparc64/linux_load.c trunk/openbios-devel/arch/x86/linux_load.c
Modified: trunk/openbios-devel/arch/sparc32/linux_load.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/linux_load.c Sat Aug 7 14:49:53 2010 (r840) +++ trunk/openbios-devel/arch/sparc32/linux_load.c Sun Aug 8 20:28:48 2010 (r841) @@ -461,7 +461,7 @@ uint64_t forced;
fd = open_io(initrd_file); - if (!fd) { + if (fd == -1) { printf("Can't open initrd: %s\n", initrd_file); return -1; } @@ -609,8 +609,9 @@ char *initrd_file = NULL;
fd = open_io(file); - if (!fd) + if (fd == -1) { return -1; + }
kern_addr = load_linux_header(&hdr); if (kern_addr == 0) {
Modified: trunk/openbios-devel/arch/sparc64/linux_load.c ============================================================================== --- trunk/openbios-devel/arch/sparc64/linux_load.c Sat Aug 7 14:49:53 2010 (r840) +++ trunk/openbios-devel/arch/sparc64/linux_load.c Sun Aug 8 20:28:48 2010 (r841) @@ -461,7 +461,7 @@ uint64_t forced;
fd = open_io(initrd_file); - if (!fd) { + if (fd == -1) { printf("Can't open initrd: %s\n", initrd_file); return -1; } @@ -609,7 +609,7 @@ char *initrd_file = NULL;
fd = open_io(file); - if (!fd) + if (fd == -1) return -1;
kern_addr = load_linux_header(&hdr);
Modified: trunk/openbios-devel/arch/x86/linux_load.c ============================================================================== --- trunk/openbios-devel/arch/x86/linux_load.c Sat Aug 7 14:49:53 2010 (r840) +++ trunk/openbios-devel/arch/x86/linux_load.c Sun Aug 8 20:28:48 2010 (r841) @@ -462,7 +462,7 @@ uint64_t forced;
fd = open_io(initrd_file); - if (!fd) { + if (fd == -1) { printf("Can't open initrd: %s\n", initrd_file); return -1; } @@ -634,8 +634,9 @@ char *initrd_file = NULL;
fd = open_io(file); - if (!fd) + if (fd == -1) { return -1; + }
kern_addr = load_linux_header(&hdr); if (kern_addr == 0)