From: Emmanuel Gil Peyrot Date: Wed, 20 Nov 2019 15:21:42 +0000 (+0100) Subject: intel/compiler: Return early if read() failed X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5f78524d9b5c579d492470ebd635178339a551a6;p=mesa.git intel/compiler: Return early if read() failed This was the only warning I could see while compiling Iris. Reviewed-by: Matt Turner Tested-by: Marge Bot Part-of: --- 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,