diff options
author | Emmanuel Gil Peyrot <[email protected]> | 2019-11-20 16:21:42 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-22 20:52:47 +0000 |
commit | 5f78524d9b5c579d492470ebd635178339a551a6 (patch) | |
tree | 499a76b3dc4451d47961c8cead1a4e5ece56219b /src/intel/compiler | |
parent | 8490b7d917c46951e3bc6708000fb542350b814b (diff) |
intel/compiler: Return early if read() failed
This was the only warning I could see while compiling Iris.
Reviewed-by: Matt Turner <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2821>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2821>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r-- | src/intel/compiler/brw_eu.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/intel/compiler/brw_eu.cpp b/src/intel/compiler/brw_eu.cpp index 4ce36fc2597..16600bdc537 100644 --- a/src/intel/compiler/brw_eu.cpp +++ b/src/intel/compiler/brw_eu.cpp @@ -394,8 +394,11 @@ bool brw_try_override_assembly(struct brw_codegen *p, int start_offset, p->store = (brw_inst *)reralloc_size(p->mem_ctx, p->store, p->next_insn_offset); assert(p->store); - read(fd, p->store + start_offset, sb.st_size); + ssize_t ret = read(fd, p->store + start_offset, sb.st_size); close(fd); + if (ret != sb.st_size) { + return false; + } ASSERTED bool valid = brw_validate_instructions(p->devinfo, p->store, |