clover: Report error when pipe driver fails to create compute state
authorJan Vesely <jan.vesely@rutgers.edu>
Tue, 17 Jul 2018 06:07:45 +0000 (02:07 -0400)
committerJan Vesely <jan.vesely@rutgers.edu>
Wed, 18 Jul 2018 01:04:15 +0000 (21:04 -0400)
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/core/kernel.cpp

index 471670532317f28077193f3871341c4ad9233f49..dab7ef8683a89dee1d9f0cde98e1ce12ada20682 100644 (file)
@@ -231,6 +231,10 @@ kernel::exec_context::bind(intrusive_ptr<command_queue> _q,
       cs.req_local_mem = mem_local;
       cs.req_input_mem = input.size();
       st = q->pipe->create_compute_state(q->pipe, &cs);
+      if (!st) {
+        unbind(); // Cleanup
+        throw error(CL_OUT_OF_RESOURCES);
+      }
    }
 
    return st;