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>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@841 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2010-08-08 18:28:48 +00:00
parent f7717af419
commit 84518defd6
3 changed files with 8 additions and 6 deletions

View File

@@ -462,7 +462,7 @@ static int load_initrd(struct linux_header *hdr, struct sys_info *info,
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 @@ int linux_load(struct sys_info *info, const char *file, const char *cmdline)
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)