mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
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:
@@ -461,7 +461,7 @@ static int load_initrd(struct linux_header *hdr, uint32_t kern_end,
|
||||
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 @@ 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) {
|
||||
|
||||
@@ -461,7 +461,7 @@ static int load_initrd(struct linux_header *hdr, uint32_t kern_end,
|
||||
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 @@ 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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user