read_file_2: Fix return value
PATCH 1/1 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 <[email protected]>
--- lib/libfile.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
lib/libfile.c +3 -1
@@ -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 )
Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 4 lines · Teresa Gámez
Set return value correct in error case.
This prevents barebox from crashing in some conditions.Signed-off-by Teresa Gámez <[email protected]>
Applied, thanks
Sascha
Quoted 28 lines
--- lib/libfile.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)lib/libfile.c +3
-1@@ -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 )Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox