[flashrom] [PATCH] CID1129998/1129999: Unchecked return value from library
Stefan Tauner
stefan.tauner at alumni.tuwien.ac.at
Sat Apr 26 13:28:51 CEST 2014
On Tue, 19 Nov 2013 20:35:57 +0100
Stefan Reinauer <stefan.reinauer at coreboot.org> wrote:
> Index: serial.c
> ===================================================================
> --- serial.c (revision 1763)
> +++ serial.c (working copy)
> @@ -181,7 +181,10 @@
> msg_pdbg("Baud rate is %ld.\n", dcb.BaudRate);
> #else
> struct termios wanted, observed;
> - fcntl(fd, F_SETFL, 0);
> + if (fcntl(fd, F_SETFL, 0) != 0) {
> + msg_perr_strerror("Could not set serial port mode: ");
> + return 1;
> + }
> if (tcgetattr(fd, &observed) != 0) {
> msg_perr_strerror("Could not fetch original serial port configuration: ");
> return 1;
Why do we clear all file descriptor flags anyway? The code is from
Urja, hence the CC.
--
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
More information about the flashrom
mailing list