ectool: Don't ignore fgets return code
Change-Id: I12dc449e06dee31b4b0811ab23c6e8635cf31512 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46667 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
9d50efe19d
commit
3a7825983c
|
@ -167,7 +167,10 @@ int get_ec_ports(void)
|
|||
return -1;
|
||||
|
||||
while (!feof(fp) && (data == 0 || cmd == 0)) {
|
||||
fgets(line, sizeof(line), fp);
|
||||
if (fgets(line, sizeof(line), fp) == NULL) {
|
||||
fprintf(stderr, "Can not read from /proc/ioports.\n");
|
||||
break;
|
||||
}
|
||||
if (strstr(line, "EC data") != NULL)
|
||||
data = strtol(line, NULL, 16);
|
||||
|
||||
|
|
Loading…
Reference in New Issue