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:
Blue Swirl
2010-08-07 12:49:52 +00:00
parent 76715fe930
commit 988f780aa5
4 changed files with 8 additions and 4 deletions

View File

@@ -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");