9
0
Fork 0

read_file_2: Fix return value

Set return value correct in error case.
This prevents barebox from crashing in some conditions.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Teresa Gámez 2014-09-24 08:49:51 +02:00 committed by Sascha Hauer
parent ea569b0a7a
commit 9d50b34845
1 changed files with 3 additions and 1 deletions

View File

@ -163,8 +163,10 @@ again:
buf = xzalloc(read_size + 1);
fd = open(filename, O_RDONLY);
if (fd < 0)
if (fd < 0) {
ret = fd;
goto err_out;
}
ret = read_full(fd, buf, read_size);
if (ret < 0)