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:
parent
ea569b0a7a
commit
9d50b34845
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue