intel/compiler: Return early if read() failed

This was the only warning I could see while compiling Iris.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2821>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2821>
This commit is contained in:
Emmanuel Gil Peyrot
2019-11-20 16:21:42 +01:00
committed by Marge Bot
parent 8490b7d917
commit 5f78524d9b

View File

@@ -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,