mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: util/broadcom: Check for successful file access
Change-Id: I5c77b3c5ea3fbc249a8c564a521c2c3c45e1c560 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1323510 Reviewed-on: https://review.coreboot.org/17877 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com> Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/421284 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
42df699056
commit
9597841a3b
1 changed files with 5 additions and 0 deletions
|
@ -73,6 +73,11 @@ int DataRead(char *filename, uint8_t *buf, int *length)
|
|||
return -1;
|
||||
}
|
||||
len = FileSizeGet(file);
|
||||
if (len < 0) {
|
||||
printf("Unable to seek in file: %s\n", filename);
|
||||
fclose(file);
|
||||
return -1;
|
||||
}
|
||||
if (len < *length)
|
||||
*length = len;
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue