mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
loaders: fix open_ih return value checks
open_ih() 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@839 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -33,8 +33,9 @@ int forth_load(ihandle_t dev)
|
||||
feval("0 state-valid !");
|
||||
|
||||
fd = open_ih(dev);
|
||||
if (!fd)
|
||||
if (fd == -1) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (read_io(fd, magic, 2) != 2) {
|
||||
debug("Can't read magic header\n");
|
||||
|
||||
Reference in New Issue
Block a user