<div dir="ltr">Does this fix something?  If I understand correctly, the first blob_write to fail will set out_of_memory and all subsequent blob_writes will fail.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 29, 2018 at 9:12 AM, Eric Engestrom <span dir="ltr"><<a href="mailto:eric.engestrom@intel.com" target="_blank">eric.engestrom@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Eric Engestrom <<a href="mailto:eric.engestrom@intel.com">eric.engestrom@intel.com</a>><br>
---<br>
 src/intel/vulkan/anv_pipeline_<wbr>cache.c | 38 +++++++++++++--------------<br>
 1 file changed, 19 insertions(+), 19 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>pipeline_cache.c b/src/intel/vulkan/anv_<wbr>pipeline_cache.c<br>
index 82551e9f81f293ecadbe..<wbr>6c0edaf1ec1b773802e1 100644<br>
--- a/src/intel/vulkan/anv_<wbr>pipeline_cache.c<br>
+++ b/src/intel/vulkan/anv_<wbr>pipeline_cache.c<br>
@@ -96,29 +96,29 @@ static bool<br>
 anv_shader_bin_write_to_blob(<wbr>const struct anv_shader_bin *shader,<br>
                              struct blob *blob)<br>
 {<br>
-   bool ok;<br>
+   bool ok = true;<br>
<br>
-   ok = blob_write_uint32(blob, shader->key->size);<br>
-   ok = blob_write_bytes(blob, shader->key->data, shader->key->size);<br>
+   ok &= blob_write_uint32(blob, shader->key->size);<br>
+   ok &= blob_write_bytes(blob, shader->key->data, shader->key->size);<br>
<br>
-   ok = blob_write_uint32(blob, shader->kernel_size);<br>
-   ok = blob_write_bytes(blob, shader->kernel.map, shader->kernel_size);<br>
+   ok &= blob_write_uint32(blob, shader->kernel_size);<br>
+   ok &= blob_write_bytes(blob, shader->kernel.map, shader->kernel_size);<br>
<br>
-   ok = blob_write_uint32(blob, shader->prog_data_size);<br>
-   ok = blob_write_bytes(blob, shader->prog_data, shader->prog_data_size);<br>
-   ok = blob_write_bytes(blob, shader->prog_data->param,<br>
-                               shader->prog_data->nr_params *<br>
-                               sizeof(*shader->prog_data-><wbr>param));<br>
+   ok &= blob_write_uint32(blob, shader->prog_data_size);<br>
+   ok &= blob_write_bytes(blob, shader->prog_data, shader->prog_data_size);<br>
+   ok &= blob_write_bytes(blob, shader->prog_data->param,<br>
+                                shader->prog_data->nr_params *<br>
+                                sizeof(*shader->prog_data-><wbr>param));<br>
<br>
-   ok = blob_write_uint32(blob, shader->bind_map.surface_<wbr>count);<br>
-   ok = blob_write_uint32(blob, shader->bind_map.sampler_<wbr>count);<br>
-   ok = blob_write_uint32(blob, shader->bind_map.image_count);<br>
-   ok = blob_write_bytes(blob, shader->bind_map.surface_to_<wbr>descriptor,<br>
-                               shader->bind_map.surface_count *<br>
-                               sizeof(*shader->bind_map.<wbr>surface_to_descriptor));<br>
-   ok = blob_write_bytes(blob, shader->bind_map.sampler_to_<wbr>descriptor,<br>
-                               shader->bind_map.sampler_count *<br>
-                               sizeof(*shader->bind_map.<wbr>sampler_to_descriptor));<br>
+   ok &= blob_write_uint32(blob, shader->bind_map.surface_<wbr>count);<br>
+   ok &= blob_write_uint32(blob, shader->bind_map.sampler_<wbr>count);<br>
+   ok &= blob_write_uint32(blob, shader->bind_map.image_count);<br>
+   ok &= blob_write_bytes(blob, shader->bind_map.surface_to_<wbr>descriptor,<br>
+                                shader->bind_map.surface_count *<br>
+                                sizeof(*shader->bind_map.<wbr>surface_to_descriptor));<br>
+   ok &= blob_write_bytes(blob, shader->bind_map.sampler_to_<wbr>descriptor,<br>
+                                shader->bind_map.sampler_count *<br>
+                                sizeof(*shader->bind_map.<wbr>sampler_to_descriptor));<br>
<br>
    return ok;<br>
 }<br>
<span class="HOEnZb"><font color="#888888">-- <br>
Cheers,<br>
  Eric<br>
<br>
</font></span></blockquote></div><br></div>