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

@@ -81,8 +81,9 @@ aout_load(struct sys_info *info, ihandle_t dev)
feval("0 state-valid !");
fd = open_ih(dev);
if (!fd)
if (fd == -1) {
goto out;
}
for (offset = 0; offset < 16 * 512; offset += 512) {
seek_io(fd, offset);